首页 > 其他 > 详细

【原创】大数据基础之Hive(1)最简部署

时间:2019-02-25 11:52:28      阅读:151      评论:0      收藏:0      [点我收藏+]

hadoop部署参考:https://www.cnblogs.com/barneywill/p/10428098.html

 

1 拷贝到所有服务器上并解压

# 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‘

2 拷贝mysql-connector-java.jar

# ansible all-servers -m shell -a ‘cp /path/to/mysql-connector-java.jar /app/path/apache-hive-2.3.4-bin/lib/‘

3 准备配置文件

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>

4 将配置同步到所有服务器上

# ansible all-servers -m copy -a ‘src=/path/to/config/ dest=/app/path/apache-hive-2.3.4-bin/conf/‘

5 初始化数据库

# 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

6 启动metastore

# su - hadoop
$ /app/path/apache-hive-2.3.4-bin/bin/hive --service metastore

7 启动hive thrift server

# su - hadoop
$ /app/path/apache-hive-2.3.4-bin/bin/hive --service hiveserver2

 

【原创】大数据基础之Hive(1)最简部署

原文:https://www.cnblogs.com/barneywill/p/10429929.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!