Mysql:node1
MetaStore Server:node2
Hive:node2
-
1 在node1上安装mysql
-yum install mysql-server –y
修改mysql的权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
删除多余的权限
delete from user where host != '%';
刷新权限:
flush privileges;
-
1 在node2上安装Hive
修改Hive配置文件
cp hive-default.xml.template hive-site.xml
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://node1:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123</value>
</property>
<property>
<name>hive.metastore.local</name>
<value>false</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://node2:9083</value>
</property>
导入mysql的驱动包
cp /root/mysql-connector-java-5.1.32-bin.jar /home/hive-1.2.1/lib/
修改hadoop的jline版本
cp /home/hive-1.2.1/lib/jline-2.12.jar /home/hadoop-2.5.1/share/hadoop/yarn/lib/
启动服务端
hive --service metastore