Set up Hive
The additional steps provided in this procedure a required to configure Hive.
When using Hive, you should also ensure that the Hive metastore warehouse is being directed to the ViPRFS location. Assuming that mysql is being used to identify the Hive metastore location, start mysql, go to the Hive databases, and show the contents of the DBS table and set it as below.
If Hive is using templeton, you should modify the following properties, and these properties are already defined.
Table 1. Hive templeton configuration The table lists te Hive templeton configuration
Hadoop location
Property
Value (example)
Advanced webhcat-site
templeton.hive.archive
viprfs://hdfsBucket2.s3.site1/hdp/apps/${hdp.version}/hive/hive.tar.gz
templeton.pig.archive
viprfs://hdfsBucket2.s3.site1/hdp/apps/${hdp.version}/pig/pig.tar.gz
templeton.sqoop.archive
viprfs://hdfsBucket2.s3.site1/hdp/apps/${hdp.version}/sqoop/sqoop.tar.gz
templeton.streaming.jar
viprfs://hdfsBucket2.s3.site1/hdp/apps/${hdp.version}/mapreduce/hadoop-streaming.jar
Start mysql.
[root@hdfs-pansy2 lib]# mysql -u hive -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Go to the Hive database.
mysql> use hive;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Show the contents of the database.
select * from DBS;
+------+-------------+-----------------------------------+--------+-------+------+
|DB_ID | DESC | DB_LOCATION_URI | NAME | OWNER | OWNER|
| | | | | _NAME | _TYPE|
+------+-------------+-----------------------------------+--------+-------+------+
| 1 | Default Hive| hdfs://hdfs-pansy1.ecs.lab.emc. |default |public |ROLE |
| | database | com:8020/apps/hive/warehouse | | | |
| | | | | | |
| 6 | NULL | viprfs://hdfsbucket.ns.Site1/ |retail |hdfs |USER |
| | | apps/hive/warehouse/retail_demo.db| _demo | | |
+------+-------------+-----------------------------------+--------+-------+------+
2 rows in set (0.00 sec)
Change the database.
mysql> update DBS set DB_LOCATION_URI='viprfs://hdfsbucket3.ns.Site1/apps/hive/warehouse' where DB_ID=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0