在
Hive入门学习之二:Hive 的部署
中讲述了如何搭建一个Hive的环境,本文主要讲解基于metastore启动多个client的方法
- 要求说明
centos01中已经配置好了hive环境,需要在该机器上启动metastore服务,接下来需要在centos02,centos03中启动客户端 - 具体步骤
- 拷贝centos01的hive环境到centos02,centos03
scp -r apache-hive-1.2.1-bin root@centos03:/opt/cloud/
scp -r apache-hive-1.2.1-bin root@centos03:/opt/cloud/ - 修改centos02,centos03的hive-size.xml文件如下
<property>
<name>hive.metastore.uris</name>
<value>thrift://centos01:9083</value>
<description>Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property> - 在centos01上后台运行metastore服务
nohup bin/hive --service metastore > metastore.log 2>&1 & - 在centos02,centos03上运行hive服务
- 在centos01上发现9083端口已经被连接