1.安装mysql
rpm
-ivh MySQL-server-community-6.0.11-0.rhel5.i386.rpm
rpm -ivh MySQL-client-community-6.0.11-0.rhel5.i386.rpm
2.启动mysql服务
/sbin/service mysql
start
3.登陆mysql服务器,建立hive用户名和密码
mysql -uroot –p
GRANT
ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'hive' WITH GRANT OPTION ;
FLUSH PRIVILEGES(刷新权限,必做操作)
4.解压Hive包并配置JDBC连接地址
tar
-xzvf hive-0.9.0.tar.gz
cp
mysql-connector-java-5.1.20-bin.jar
/opt/modules/hive/hive-0.9.0/lib/ (将mysql驱动包加入到hive lib目录中)
5.
修改一下hive-site mysql JDBC节点内容
javax.jdo.option.ConnectionURL
jdbc:mysql://192.168.1.100:3306/hive?createDatabaseIfNotExist=true
JDBC connect string for a
JDBC metastore
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
Driver class name for a
JDBC metastore
javax.jdo.option.ConnectionUserName
hive
username to use against
metastore database
javax.jdo.option.ConnectionPassword
hive
password to use against
metastore database
6.添加Mysql Hive用户名和密码,创建Hive 仓库
创建
Hive metastore
create database hive;
7.启动hive thift server
hive --service
hiveserver 10001
测试端口 :netstat -nap |grep 10001
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26834311/viewspace-1063621/
,如需转载,请注明出处,否则将追究法律责任。