Mysql:node1
MetaStore Server:node2
Hive:node2
-
1 在node1上安裝mysql
-yum install mysql-server –y
修改mysql的權(quán)限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
刪除多余的權(quán)限
delete from user where host != '%';
刷新權(quán)限:
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>
導(dǎo)入mysql的驅(qū)動(dòng)包
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/
啟動(dòng)服務(wù)端
hive --service metastore