打赏

HBase的多节点集群详细启动步骤(3或5节点)(分为Zookeeper自带还是外装)

 

 

HBase的多节点集群详细启动步骤(3或5节点)分为

  1、HBASE_MANAGES_ZK的默认值是false(zookeeper外装)(推荐)

  2、HBASE_MANAGES_ZK的默认值是true(zookeeper自带)

 

 

 

 

 

 

 

1、HBASE_MANAGES_ZK的默认值是false(推荐)

  伪分布模式下,如(weekend110)
  hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是true,它表示HBase使用自身自带的Zookeeper实例。但是,该实例只能为单机或伪分布模式下的HBase提供服务。

 

  若是分布式模式,则需要配置自己的Zookeeper集群。如(HadoopMaster、HadoopSlave1、HadoopSlave2)
  hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是true,它表示,分布式模式里,在启动HBase时,HBase将Zookeeper作为自身的一部分运行。进程变为HQuorumPeer。
  hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是false,它表示,分布式模式里,需要,先提前手动,每个节点都手动启动Zookeeper,然后再在主节点上启动HBase时,进程变为HMaster(HadoopMaster节点)。

 


  若,HBASE_MANAGES_ZK的默认值是false
1、则,直接在HadoopMaster机器上,先启动Hadoop,
2、在HadoopMaster、HadoopSlave1、HadoopSlave2机器上,分别手动一个一个得去,启动Zookeeper
3、在HadoopMaster机器上,再启动HBase即可。

 


  1、则,直接在HadoopMaster机器上,先启动Hadoop,
[hadoop@HadoopMaster hadoop-2.6.0]$ jps
1998 Jps
[hadoop@HadoopMaster hadoop-2.6.0]$ sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
16/11/02 19:59:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [HadoopMaster]
HadoopMaster: starting namenode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-namenode-HadoopMaster.out
HadoopSlave1: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-datanode-HadoopSlave1.out
HadoopSlave2: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-datanode-HadoopSlave2.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-secondarynamenode-HadoopMaster.out
16/11/02 20:00:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-resourcemanager-HadoopMaster.out
HadoopSlave2: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-nodemanager-HadoopSlave2.out
HadoopSlave1: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-nodemanager-HadoopSlave1.out
[hadoop@HadoopMaster hadoop-2.6.0]$ jps
2281 SecondaryNameNode
2124 NameNode
2430 ResourceManager
2736 Jps

[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
1877 Jps
[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
2003 NodeManager
2199 Jps
1928 DataNode
[hadoop@HadoopSlave1 hadoop-2.6.0]$

[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
1893 Jps
[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
2019 NodeManager
2195 Jps
1945 DataNode
[hadoop@HadoopSlave2 hadoop-2.6.0]$

 

  2、在HadoopMaster、HadoopSlave1、HadoopSlave2机器上,分别手动一个一个得去,启动Zookeeper
[hadoop@HadoopMaster hadoop-2.6.0]$cd ..
[hadoop@HadoopMaster app]$ cd zookeeper-3.4.6/
[hadoop@HadoopMaster zookeeper-3.4.6]$ bin/zkServer.sh start
[hadoop@HadoopSlave1 zookeeper-3.4.6]$ bin/zkServer.sh start
[hadoop@HadoopSlave2 zookeeper-3.4.6]$ bin/zkServer.sh start

 


  3、在HadoopMaster机器上,再启动HBase即可。
[hadoop@HadoopMaster hadoop-2.6.0]$ cd ..
[hadoop@HadoopMaster app]$ cd hbase-1.2.3
[hadoop@HadoopMaster hbase-1.2.3]$ bin/start-hbase.sh
HadoopSlave2: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopSlave2.out
HadoopSlave1: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopSlave1.out
HadoopMaster: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopMaster.out
starting master, logging to /home/hadoop/app/hbase-1.2.3/logs/hbase-hadoop-master-HadoopMaster.out
HadoopSlave1: starting regionserver, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-regionserver-HadoopSlave1.out
HadoopSlave2: starting regionserver, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-regionserver-HadoopSlave2.out
[hadoop@HadoopMaster hbase-1.2.3]$ jps

 

 

  进入hbase shell啊,只有HadoopMaster才可进,
[hadoop@HadoopMaster hbase-1.2.3]$ hbase shell
2016-11-02 20:07:31,288 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/hbase-1.2.3/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.3, rbd63744624a26dc3350137b564fe746df7a721a4, Mon Aug 29 15:13:42 PDT 2016

hbase(main):001:0>

[hadoop@HadoopSlave1 hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[hadoop@HadoopSlave1 hadoop-2.6.0]$

[hadoop@HadoopSlave2 hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[hadoop@HadoopSlave2 hadoop-2.6.0]$


退出hbase shell啊
hbase(main):001:0> exit
[hadoop@HadoopMaster hbase-1.2.3]$

 

 

 

 

 

 

 

 

2、HBASE_MANAGES_ZK的默认值是true

  伪分布模式下,如(weekend110、djt002)
hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是true,它表示HBase使用自身自带的Zookeeper实例。
但是,该实例只能为单机或伪分布模式下的HBase提供服务。


  若是分布式模式,则需要配置自己的Zookeeper集群。如(HadoopMaster、HadoopSlave1、HadoopSlave2)
  hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是true,它表示,分布式模式里,在启动HBase时,HBase将Zookeeper作为自身的一部分运行。进程变为HQuorumPeer。
  hbase-env.sh配置文档中的HBASE_MANAGES_ZK的默认值是false,它表示,分布式模式里,需要,先提前手动,每个节点都手动启动Zookeeper,然后再在主节点上启动HBase时,进程变为HMaster(HadoopMaster节点)。

 


  若,HBASE_MANAGES_ZK的默认值是true
1、则,直接在HadoopMaster机器上,先启动Hadoop,
2、再启动HBase即可。

 

 

 

 

 

  1、则,直接在HadoopMaster机器上,先启动Hadoop,
[hadoop@HadoopMaster hadoop-2.6.0]$ jps
1998 Jps
[hadoop@HadoopMaster hadoop-2.6.0]$ sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
16/11/02 19:59:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [HadoopMaster]
HadoopMaster: starting namenode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-namenode-HadoopMaster.out
HadoopSlave1: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-datanode-HadoopSlave1.out
HadoopSlave2: starting datanode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-datanode-HadoopSlave2.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/app/hadoop-2.6.0/logs/hadoop-hadoop-secondarynamenode-HadoopMaster.out
16/11/02 20:00:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-resourcemanager-HadoopMaster.out
HadoopSlave2: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-nodemanager-HadoopSlave2.out
HadoopSlave1: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0/logs/yarn-hadoop-nodemanager-HadoopSlave1.out
[hadoop@HadoopMaster hadoop-2.6.0]$ jps
2281 SecondaryNameNode
2124 NameNode
2430 ResourceManager
2736 Jps

[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
1877 Jps
[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
2003 NodeManager
2199 Jps
1928 DataNode
[hadoop@HadoopSlave1 hadoop-2.6.0]$

[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
1893 Jps
[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
2019 NodeManager
2195 Jps
1945 DataNode
[hadoop@HadoopSlave2 hadoop-2.6.0]$

 


  2、再启动HBase即可。
[hadoop@HadoopMaster hadoop-2.6.0]$ cd ..
[hadoop@HadoopMaster app]$ cd hbase-1.2.3
[hadoop@HadoopMaster hbase-1.2.3]$ bin/start-hbase.sh
HadoopSlave2: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopSlave2.out
HadoopSlave1: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopSlave1.out
HadoopMaster: starting zookeeper, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-zookeeper-HadoopMaster.out
starting master, logging to /home/hadoop/app/hbase-1.2.3/logs/hbase-hadoop-master-HadoopMaster.out
HadoopSlave1: starting regionserver, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-regionserver-HadoopSlave1.out
HadoopSlave2: starting regionserver, logging to /home/hadoop/app/hbase-1.2.3/bin/../logs/hbase-hadoop-regionserver-HadoopSlave2.out
[hadoop@HadoopMaster hbase-1.2.3]$ jps
3201 Jps
2281 SecondaryNameNode
2951 HQuorumPeer
2124 NameNode
2430 ResourceManager
3013 HMaster
[hadoop@HadoopMaster hbase-1.2.3]$

[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
2336 HRegionServer
2003 NodeManager
2396 Jps
2257 HQuorumPeer
1928 DataNode
[hadoop@HadoopSlave1 hadoop-2.6.0]$

[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
2019 NodeManager
2254 HQuorumPeer
2451 Jps
2333 HRegionServer
1945 DataNode
[hadoop@HadoopSlave2 hadoop-2.6.0]$

 


  进入hbase shell啊,只有HadoopMaster才可进,
[hadoop@HadoopMaster hbase-1.2.3]$ hbase shell
2016-11-02 20:07:31,288 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/hbase-1.2.3/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.3, rbd63744624a26dc3350137b564fe746df7a721a4, Mon Aug 29 15:13:42 PDT 2016

hbase(main):001:0>

[hadoop@HadoopSlave1 hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[hadoop@HadoopSlave1 hadoop-2.6.0]$

[hadoop@HadoopSlave2 hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[hadoop@HadoopSlave2 hadoop-2.6.0]$


退出hbase shell啊
hbase(main):001:0> exit
[hadoop@HadoopMaster hbase-1.2.3]$

 

   

 

posted @ 2017-03-15 13:26  大数据和AI躺过的坑  阅读(4923)  评论(0编辑  收藏  举报