• 虚拟机zookeeper和hbase集群搭建


    集群zookeeper

    dataDir=/usr/local/zookeeper/dataDir
    dataLogDir=/usr/local/zookeeper/dataLogDir
    # the port at which the clients will connect
    clientPort=2181
    # master
    server.1=sjck-node01:2888:3888
    server.2=sjck-node02:2888:3888
    server.3=sjck-node03:2888:3888
    

    myid

    [root@sjck-node01 dataDir]# cat /usr/local/zookeeper/dataDir/myid 
    1
    [root@sjck-node02 dataDir]# cat /usr/local/zookeeper/dataDir/myid 
    2
    [root@sjck-node03 dataDir]# cat /usr/local/zookeeper/dataDir/myid 
    3
    

    环境配置

    export ZK_HOME=/usr/local/zookeeper
    export PATH=$PATH:$ZK_HOME/bin
    
    source  /etc/profile
    

    集群启动,在每台机子上都执行

    /usr/local/zookeeper/bin/zkServer.sh start
    /usr/local/zookeeper/bin/zkServer.sh stop
    

    查看集群状态

    [root@sjck-node01 dataDir]# /usr/local/zookeeper/bin/zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
    Mode: follower
    [root@sjck-node02 dataDir]# /usr/local/zookeeper/bin/zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
    Mode: follower
    [root@sjck-node03 dataDir]# /usr/local/zookeeper/bin/zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
    Mode: leader
    

    hbase环境配置

    export HBASE_HOME=/usr/local/hbase
    export PATH=$PATH:$HBASE_HOME/bin
    
    source  /etc/profile
    

    查看版本

    [root@sjck-node01 hbase]# hbase version
    HBase 1.3.1
    Source code repository git://mantonov-mbp1/Users/mantonov/hbase revision=930b9a55528fe45d8edce7af42fef2d35e77677a
    Compiled by mantonov on Thu Apr  6 19:36:54 PDT 2017
    From source with checksum a34b810bed77b3a56af797405bea7c78
    

    hbase-env.sh

    export JAVA_HOME=/usr/local/src/jdk/jdk1.8
    export HBASE_MANAGES_ZK=false
    export HADOOP_HOME=/usr/local/hadoop
    export HBASE_HOME=/usr/local/hbase
    export HBASE_CLASSPATH=/usr/local/hadoop/etc/hadoop/
    

    hbase-site.xml

    <configuration>
        <property>
            <name>hbase.rootdir</name>
            <value>hdfs://sjck-node01:9000/hbase</value>
        </property>
        <property>
            <name>hbase.master</name>
            <value>sjck-node01:60000</value>
        </property>
        <property>
            <name>hbase.cluster.distributed</name>
            <value>true</value>
        </property>
        <property>
            <name>hbase.zookeeper.property.clientPort</name>
            <value>2181</value>
        </property>
        <property>
            <name>hbase.zookeeper.quorum</name>
            <value>sjck-node01,sjck-node02,sjck-node03</value>
        </property>
        <property>
            <name>zookeeper.session.timeout</name>
            <value>120000</value>
        </property>
        <property>
            <name>dfs.support.append</name>
            <value>true</value>
        </property>
    </configuration>
    

    regionservers

    sjck-node02
    sjck-node03
    

    master启动hbase

    start-hbase.sh
    stop-hbase.sh
    

    集群启动状态,主节点是HMaster,其余是HRegionServer

    [root@sjck-node01 bin]# jps
    3104 NameNode
    3893 HMaster
    4133 Jps
    3273 SecondaryNameNode
    3739 QuorumPeerMain
    3455 ResourceManager
    [root@sjck-node02 local]# jps
    3157 DataNode
    3477 HRegionServer
    3270 NodeManager
    3403 QuorumPeerMain
    3679 Jps
    [root@sjck-node03 local]# jps
    3731 HRegionServer
    3923 Jps
    3399 DataNode
    3656 QuorumPeerMain
    3517 NodeManager
    

    web管理页面

    http://172.16.92.128:16010/master-status

    hbase shell

    [root@sjck-node01 bin]# hbase shell
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    hbase(main):001:0> 
    
  • 相关阅读:
    window.showModalDialog使用手册
    javascrīpt 对象的定义
    导航上用CSS标志当前页效果的实现
    数据库中的命名规则
    Oracle数学函数
    实现 asp 的服务器无刷新推技术
    UML建模工具比较
    Oracle日期函数
    神秘的 ORACLE DUAL
    Podcast Publisher——一个综合了多种入门知识的小Web应用
  • 原文地址:https://www.cnblogs.com/wanli002/p/10706816.html
Copyright © 2020-2023  润新知