Using Configuration Properties to Authenticate
To configure authentication with S3, explicitly declare the credentials in a
configuration file such as core-site.xml
.
The credential need to be added to the HDFS service in Cloudera Manager to correctly
propagate them to the relevant services. You need to complete the following steps to configure
the credentials in Cloudera Manager:
- Go to your cluster in Cloudera Manager.
- Select HDFS from the list of services.
- Select Configuration.
- Search for Cluster-wide Advanced Configuration Snippet (Safety Valve) for core-site.xml in the search bar.
- Add the following properties and values to the Cluster-wide Advanced
Configuration Snippet (Safety Valve) for core-site.xml
field:
<property> <name>fs.s3a.access.key</name> <value>[***ACCESS KEY***]</value> </property> <property> <name>fs.s3a.secret.key</name> <value>[***SECRET KEY***]</value> </property>
If using AWS session credentials for authentication, the secret key must be that of the session, and thefs.s3a.session.token
option set to your session token.<property> <name>fs.s3a.session.token</name> <value>[***SESSION TOKEN***]</value> </property>
- Click Save changes.
- Restart the required services.
This configuration can be added for a specific bucket. For more information, see Using Per-Bucket Credentials to Authenticate.
To protect these credentials, we recommend that you use the credential provider framework to securely store and access your credentials.
To validate that you can successfully authenticate with S3, try referencing S3 in a URL.