11 完成metastore的高可用

本节将介绍metastore的高可用配置。

1、前提约束

  • 有两台服务器[虚拟机也可以],假设这两台服务器的ip、域名分别为:
    192.168.100.141 hadoop1
    192.168.100.142 hadoop2
    且已经设置免密登录和关闭防火墙,且已安装jdk并配置环境变量
  • 都已经安装zookeeper集群
    https://www.jianshu.com/p/48f142f876d4
    假设zookeeper安装目录为/root/zookeeper-3.4.11
  • 在192.168.100.141服务器上已经安装hadoop且启动
    https://www.jianshu.com/p/b7ae3b51e559
    假设hadoop安装目录为/root/hadoop-2.5.2
  • 在192.168.100.141服务器上已经安装mysql服务且启动并允许远程访问
    https://www.jianshu.com/p/4280cdabf97d
  • 在192.168.100.141服务器上已经安装hive 的metastore服务,暂未启动
    https://www.jianshu.com/p/75ff6b1d73c5
    假设hive安装目录为/root/apache-hive-0.14.0-bin

2、操作步骤

  • 修改/root/apache-hive-0.14.0-bin/conf/hive-site.xml
<property>
 <name>hive.metastore.uris</name>
 <value>thrift://hadoop1:9083,thrift://hadoop2:9083</value>
 <description>A comma separated list of metastore uris on which metastore service is running</description>
</property>
<property>
 <name>hive.cluster.delegation.token.store.class</name>
 <value>org.apache.hadoop.hive.thrift.MemoryTokenStore</value>
 <description>Hive defaults to MemoryTokenStore, or ZooKeeperTokenStore</description>
</property>
<property>
<name>hive.zookeeper.quorum</name>
<value> hadoop1:2181,hadoop2:2181</value>
</property>

注意:hive-site.xml文件中jdbc的url要指向hadoop1

  • 拷贝相关文件夹到hadoop2
scp -r /root/apache-hive-0.14.0-bin root@hadoop2:/root
scp /etc/profile root@hadoop2:/etc/profile
ssh hadoop2
source /etc/profile
exit
  • 分别启动hadoop1和hadoop2中的metastore,此时我们整个系统就有了两个metastore,互为备份。
    以上就是metastore的高可用性配置。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值