本篇文章主要介绍了"How-to: Install hive with mysql metastore",主要涉及到方面的内容,对于MySql感兴趣的同学可以参考一下:
Install mysqlInstall mysql connector:$ curl -L 'http://www.mysql.com/get/Downloa...
- Install mysql
- Install mysql connector:
$ curl -L 'http://www.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.31.tar.gz/from/http://mysql.he.net/' | tar xz
$ sudo cp mysql-connector-java-5.1.31/mysql-connector-java-5.1.31-bin.jar ${HIVE_HOME}/lib/ - Create database and user:
mysql> CREATE DATABASE metastore;
mysql> USE metastore;
mysql> SOURCE ${HIVE_HOME}/scripts/metastore/upgrade/mysql/hive-schema-0.13.0.mysql.sql; - Grant to hive user(hive is user and metastorehost is hive node hostname):
mysql> CREATE USER 'hive'@'metastorehost' IDENTIFIED BY 'mypassword';
mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'hive'@'metastorehost';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES,EXECUTE ON metastore.* TO 'hive'@'metastorehost';
mysql> GRANT ALL PRIVILEGES ON *.* TO hive@"metastorehost " IDENTIFIED BY "mypassword" WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit; - Update hive-site.xml, take host 172.31.34.11 and hive user hive11 as example:
javax.jdo.option.ConnectionURL
jdbc:mysql://10.18.6.157:3306/metastore
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
hive11
javax.jdo.option.ConnectionPassword
hive11
datanucleus.autoCreateSchema
true
creates necessary schema on a startup if one doesn't exist. set this to false, after creating it once
datanucleus.autoCreateTables
true
datanucleus.autoCreateColumns
true
datanucleus.autoStartMechanismMode
checked
throw exception if metadata tables are incorrect
datanucleus.fixedDatastore
true
hive.metastore.schema.verification
false
- Start hive to check:
{HIVE_HOME}/bin/hive
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了How-to: Install hive with mysql metastore,包括了方面的内容,希望对MySql有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_157117.html
相关图片
相关文章