This extension allows you to do 2 things:
To use this Apache Druid extension, include
druid-s3-extensions in the extensions load list.
Reading data from S3
To read objects from S3, you must supply connection information in configuration.
S3-compatible deep storage means either AWS S3 or a compatible service like Google Storage which exposes the same API as S3.
S3 deep storage needs to be explicitly enabled by setting
druid.storage.type=s3. Only after setting the storage type to S3 will any of the settings below take effect.
Deep storage specific configuration
|Bucket to store in.||Must be set.|
|A prefix string that will be prepended to the object names for the segments published to S3 deep storage||Must be set.|
|Global deep storage provider. Must be set to ||Must be set (likely |
|S3 bucket name for archiving when running the archive task.||none|
|S3 object key prefix for archiving.||none|
|Boolean flag for how object permissions are handled. To use ACLs, set this property to ||false|
|If true, use the "s3a" filesystem when using Hadoop-based ingestion. If false, the "s3n" filesystem will be used. Only affects Hadoop-based ingestion.||false|
S3 authentication methods
The configuration options are listed in order of precedence. For example, if you would like to use profile information given in
~/.aws.credentials, do not set
druid.s3.secretKey in your Druid config file because they would take precedence.
|1||Druid config file||Based on your runtime.properties if it contains values |
|2||Custom properties file||Based on custom properties file where you can supply |
|3||Environment variables||Based on environment variables |
|4||Java system properties||Based on JVM properties |
|5||Profile information||Based on credentials you may have on your druid instance (generally in |
|6||ECS container credentials||Based on environment variables available on AWS ECS (AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or AWS_CONTAINER_CREDENTIALS_FULL_URI) as described in the EC2ContainerCredentialsProviderWrapper documentation|
|7||Instance profile information||Based on the instance profile you may have attached to your druid instance|
For more information, refer to the Amazon Developer Guide.
Alternatively, you can bypass this chain by specifying an access key and secret key using a Properties Object inside your ingestion specification.
Use the property
druid.startup.logging.maskProperties to mask credentials information in Druid logs. For example,
["password", "secretKey", "awsSecretAccessKey"].
S3 permissions settings
To manage the permissions for objects in an S3 bucket, you can use either ACLs or Object Ownership. The permissions required for each method are different.
By default, Druid uses ACLs. With ACLs, any object that Druid puts into the bucket inherits the ACL settings from the bucket.
You can switch from using ACLs to Object Ownership by setting
true. The bucket owner owns any object that gets created, so you need to use S3's bucket policies to manage permissions.
Note that this setting only affects Druid's behavior. Changing S3 to use Object Ownership requires additional configuration. For more information, see the AWS documentation on Controlling ownership of objects and disabling ACLs for your bucket.
If you're using ACLs, Druid needs the following permissions:
Object Ownership permissions
If you're using Object Ownership, Druid needs the following permissions:
The AWS SDK requires that a target region be specified. You can set these by using the JVM system property
aws.region or by setting an environment variable
For example, to set the region to 'us-east-1' through system properties:
jvm.configfile for all Druid services.
druid.indexer.runner.javaOptsin Middle Manager configuration so that the property will be passed to Peon (worker) processes.
Connecting to S3 configuration
|S3 access key. See S3 authentication methods for more details||Can be omitted according to authentication methods chosen.|
|S3 secret key. See S3 authentication methods for more details||Can be omitted according to authentication methods chosen.|
|Path to properties file containing ||Can be omitted according to authentication methods chosen.|
|Communication protocol type to use when sending requests to AWS. |
|Disables chunked encoding. See AWS document for details.||false|
|Enables path style access. See AWS document for details.||false|
|Enables global bucket access. See AWS document for details.||false|
|Service endpoint either with or without the protocol.||None|
|Region to use for SigV4 signing of requests (e.g. us-west-1).||None|
|Proxy host to connect through.||None|
|Port on the proxy host to connect through.||None|
|User name to use when connecting through a proxy.||None|
|Password to use when connecting through a proxy.||None|
|Server-side encryption type. Should be one of ||None|
|AWS KMS key ID. This is used only when ||None|
|Base64-encoded key. Should be specified if ||None|
You can enable server-side encryption by setting
druid.storage.sse.type to a supported type of server-side encryption. The current supported types are: