Testing S3 with Hive
Add the following to S3 configurations for Ozone access. Do not add any S3 credentials. For more information, see Configuring Hive access for S3A.
- Sign in to Cloudera Manager.
- Navigate to Clusters > Hive > Configurations tab.
- Search for Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml.
-
Add the following property:
<property> <name>fs.s3a.endpoint</name> <value>https://ccycloud-5.ela75-chf4.root.comops.site:9879</value> </property> <property> <name>fs.s3a.bucket.probe</name> <value>0</value> </property> <property> <name>fs.s3a.change.detection.version.required</name> <value>false</value> </property> <property> <name>fs.s3a.path.style.access</name> <value>true</value> </property> <property> <name>fs.s3a.change.detection.mode</name> <value>none</value> </property>
- Navigate to Clusters > Hive_On_Tez > Configurations tab.
- Search for Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml.
-
Add the following property:
<property> <name>fs.s3a.endpoint</name> <value>https://ccycloud-5.ela75-chf4.root.comops.site:9879</value> </property> <property> <name>fs.s3a.bucket.probe</name> <value>0</value> </property> <property> <name>fs.s3a.change.detection.version.required</name> <value>false</value> </property> <property> <name>fs.s3a.path.style.access</name> <value>true</value> </property> <property> <name>fs.s3a.change.detection.mode</name> <value>none</value> </property>
-
Update the following configurations:
- Deploy client configuration
- Restart the cluster
-
Create, insert, and select Hive tables through beeline.
create external table mytable6(key string, value int) location 's3a://obs-bucket/warehouse/hive/external/mytable6'; insert into mytable6 values("cldr",1); select * from mytable6; +-------------------+---------------------+ | mytable6.key | mytable6.value | +------------------+----------------------+ | cldr | 1 | +------------------+----------------------+