hadoop部署参考:https://www.cnblogs.com/barneywill/p/10428098.html
# ansible all-servers -m copy -a ‘src=/src/path/to/apache-hive-2.3.4-bin.tar.gz dest=/dest/path/to/‘
# ansible all-servers -m shell -a ‘tar xvf /dest/path/to/apache-hive-2.3.4-bin.tar.gz -C /app/path‘
# ansible all-servers -m shell -a ‘cp /path/to/mysql-connector-java.jar /app/path/apache-hive-2.3.4-bin/lib/‘
hive-site.xml
<configuration>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://node0:3306/hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://node0:9083</value>
</property>
</configuration>
# ansible all-servers -m copy -a ‘src=/path/to/config/ dest=/app/path/apache-hive-2.3.4-bin/conf/‘
# echo "create database hive;grant all privileges on hive.* to hive@‘%‘ identified by ‘hive‘;"|mysql -uroot -proot
# su - hadoop
$ /app/path/apache-hive-2.3.4-bin/bin/schematool -dbType mysql -initSchema
# su - hadoop
$ /app/path/apache-hive-2.3.4-bin/bin/hive --service metastore
# su - hadoop
$ /app/path/apache-hive-2.3.4-bin/bin/hive --service hiveserver2
原文:https://www.cnblogs.com/barneywill/p/10429929.html