How to Enable S3 Cloud Storage in Hue
Cloudera S3 Connector in Cloudera Manager securely connects your CDH cluster to Amazon S3.
Enable S3 in Hue with the S3 Connector Service
The Cloudera S3 Connector service is the preferred method of connecting Hue to Amazon S3. It requires a secure cluster with Kerberos and Sentry and connects to an AWS account with access keys.
- Log on to Cloudera Manager.
- Select .
- Click Add Access Key Credentials or Add IAM Role-based Authentication.
- Add any Name and enter your S3 credentials:
- To connect your AWS root user, add the Access Key ID and Secret Access Key for your root account.
- To connect an IAM user, add the Access Key ID and Secret Access Key for a read-only IAM account.
- If you have an Amazon DynamoDB database, check Enable S3Guard for consistent read operations.
- Click Enable for <cluster name> to give Hue access to S3 and S3-backed tables. Impala must have permissions defined in Sentry.
- If using access keys, select Secure or Unsecure mode. Select Unsecure to use Hive.
- Click Continue (at Step 1) if your cluster passes validation. You are automatically taken to step 5.
- Click Continue (at Step 5) to restart Hive, Impala, Oozie, and Hue.
- When finished, click Home to see the S3 Connector.
- If using IAM roles, set the region to us-east-1 in hue_safety_valve.ini. If not, ignore this step.
- Select .
- Filter by .
- Set Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini with the following:
[aws] [[aws_accounts]] [[[default]]] region=us-east-1
- Click Save Changes.
- Restart Hue: select and .
Related topics: How to Configure AWS Credentials and Configuring the Amazon S3 Connector.
Enable S3 in Hue with Safety Valves
This section assumes an AWS account with access keys, but not necessarily a Kerberized cluster.
You can connect to S3 using three safety valves (also known as Advanced Configuration Snippets):
- Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini
- Cluster-wide Advanced Configuration Snippet (Safety Valve) for core-site.xml
- Hive Service Advanced Configuration Snippet (Safety Valve) for core-site.xml.
- Log on to Cloudera Manager and select .
- Select .
- Filter by .
- Set your S3 credentials in Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini:
[aws] [[aws_accounts]] [[[default]]] access_key_id_script=</path/to/access_key_script> secret_access_key_script=</path/to/secret_key_script> #security_token=<your AWS security token> allow_environment_credentials=false region=<your region, such as us-east-1>
For a proof-of-concept installation, you can add the IDs directly.access_key_id=<your_access_key_id> secret_access_key=<your_secret_access_key>
- Clear the scope filters and search on "core-site.xml".
- To enable the S3 Browser, set your S3
credentials in Cluster-wide Advanced Configuration Snippet (Safety Valve) for core-site.xml:
<property> <name>fs.s3a.access.key</name> <value>AWS access key ID</value> </property> <property> <name>fs.s3a.secret.key</name> <value>AWS secret key</value> </property>
- To enable Hive with S3, set your S3 credentials in Hive Service Advanced Configuration Snippet (Safety Valve) for core-site.xml.
- Click Save Changes.
- Restart Hue: select and .
- Restart Hive: select and .
Related topics: How to Configure Security for Amazon S3.
Generate Access Keys in AWS
To integrate Hue with S3, you must have an Amazon Web Services (AWS) account, with access keys for either your root user or a read-only IAM user.
Root Account
- Create an AWS account and sign in to the AWS Console.
- Create access keys for this AWS root account:
- Expand the drop-down menu under your account name and select My Security Credentials.
- Click Continue to Security Credentials.
- Expand Access Keys (Access Key ID and Secret Access Key).
- Click Create New Access Key.
- Click Show Access Key or Download Key File. These are your AWS root credentials.
IAM Account
- Create two IAM groups (AWS admin and S3 Read-only):
- Go to the IAM service.
- Click Groups and Create New Group.
- Enter a name and click Next Step.
- Filter on "admin" and select the AdministratorAccess policy.
- Click Next Step and Create Group.
- Create a second group with AmazonS3ReadOnlyAccess.
- Create two IAM users and assign one to the admin policy and one to the S3 read policy.
- Click Users and Add User.
- Enter a name, and at a minimum, select Programmatic access.
- Click Next: Permissions.
- Select the group with administrator permissions.
- Click Next: Review and Create User.
- Create a second user and assign the group with S3 read-only access.
- Create access keys for your read-only IAM user:
- Click the name of your read-only IAM user.
- Click the Security Credentials tab.
- Click Create Access Key.
- Click Show Access Key or Download Key File. These are your IAM user credentials.