美文网首页
11 完成metastore的高可用

11 完成metastore的高可用

作者: 张力的程序园 | 来源:发表于2020-06-19 00:55 被阅读0次

    本节将介绍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的高可用性配置。

    相关文章

      网友评论

          本文标题:11 完成metastore的高可用

          本文链接:https://www.haomeiwen.com/subject/oxtdxktx.html