美文网首页我爱编程
hbase与zk的独立部署(standalone)

hbase与zk的独立部署(standalone)

作者: _奔跑的蜗牛_ | 来源:发表于2016-06-22 11:41 被阅读878次

    hbase版本:hbase-0.98.20-hadoop2(经测试发现1.*版本以上无法完成standalone部署)
    zk:最新版

    1、下载并解压habse
    2、修改 conf下hbase-env.sh文件,添加下面两行
    export HBASE_MANAGES_ZK=false
    export JAVA_HOME=/usr/jdk/jdk7
    
    3、修改conf下hbase-site.xml文件,在configuration标签中添加:
    <property>
    <name>hbase.zookeeper.quorum</name>
    <value>localhost</value>
    <description>The directory shared by RegionServers.
    </description>
    </property>
    <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/opt/zookeeper-3.4.8/data</value>
    <description>Property from ZooKeeper config zoo.cfg.
    The directory where the snapshot is stored.
    </description>
    </property>
    <property>
    <name>hbase.rootdir</name>
    <value>file:///opt/hbase-0.98.20-hadoop2/data</value>
    <description>The directory shared by RegionServers.
    </description>
    </property>
    <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
    <description>The mode the cluster will be in. Possible values are
      false: standalone and pseudo-distributed setups with managed Zookeeper
      true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
    </description>
    </property>
    
    4、测试hbase是否安装ok

    添加habse命令软连接到bin中

    ln -s /opt/hbase-1.1.5/bin/hbase /usr/local/bin/hbase.sh
    ln -s /opt/hbase-0.98.20-hadoop2/bin/hbase-config.sh /usr/local/bin/hbase-config.sh
    

    查看所有表记录

    hbase shell
    list
    

    注意hbase.zookeeper.property.dataDir属性值为zk的数据位置
       hbase和zookeeper需要在同一台机器

    相关文章

      网友评论

        本文标题:hbase与zk的独立部署(standalone)

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