Hbase自带zookeeper路径
Posted 柠檬芦荟加少冰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hbase自带zookeeper路径相关的知识,希望对你有一定的参考价值。
今天学习使用Hbase遇到报错:
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
......
网上查到的结果都说要清理一下zookeeper的记录,但是用的是Hbase自带的zookeeper所以根本不知道要去哪清理,也找不到路径,费了好大劲终于找到了
路径:/tmp/hbase-用户名/zookeeper
注意这里是从根目录开始,不在hbase的目录里面。zookeeper的日志文件都在version2中,删除version2整个文件夹后报错就解决了
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,
[[email protected] hadoop-2.6.0]$ jps
1998 Jps
[[email protected] 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
[[email protected] hadoop-2.6.0]$ jps
2281 SecondaryNameNode
2124 NameNode
2430 ResourceManager
2736 Jps
[[email protected] hadoop-2.6.0]$ jps
1877 Jps
[[email protected] hadoop-2.6.0]$ jps
2003 NodeManager
2199 Jps
1928 DataNode
[[email protected] hadoop-2.6.0]$
[[email protected] hadoop-2.6.0]$ jps
1893 Jps
[[email protected] hadoop-2.6.0]$ jps
2019 NodeManager
2195 Jps
1945 DataNode
[[email protected] hadoop-2.6.0]$
2、在HadoopMaster、HadoopSlave1、HadoopSlave2机器上,分别手动一个一个得去,启动Zookeeper
[[email protected] hadoop-2.6.0]$cd ..
[[email protected] app]$ cd zookeeper-3.4.6/
[[email protected]HadoopMaster zookeeper-3.4.6]$ bin/zkServer.sh start
[[email protected]HadoopSlave1 zookeeper-3.4.6]$ bin/zkServer.sh start
[[email protected]HadoopSlave2 zookeeper-3.4.6]$ bin/zkServer.sh start
3、在HadoopMaster机器上,再启动HBase即可。
[[email protected] hadoop-2.6.0]$ cd ..
[[email protected] app]$ cd hbase-1.2.3
[[email protected]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
[[email protected] hbase-1.2.3]$ jps
进入hbase shell啊,只有HadoopMaster才可进,
[[email protected] 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>
[[email protected] hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[[email protected] hadoop-2.6.0]$
[[email protected] hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[[email protected] hadoop-2.6.0]$
退出hbase shell啊
hbase(main):001:0> exit
[[email protected] 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,
[[email protected] hadoop-2.6.0]$ jps
1998 Jps
[[email protected] 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
[[email protected] hadoop-2.6.0]$ jps
2281 SecondaryNameNode
2124 NameNode
2430 ResourceManager
2736 Jps
[[email protected] hadoop-2.6.0]$ jps
1877 Jps
[[email protected] hadoop-2.6.0]$ jps
2003 NodeManager
2199 Jps
1928 DataNode
[[email protected] hadoop-2.6.0]$
[[email protected] hadoop-2.6.0]$ jps
1893 Jps
[[email protected] hadoop-2.6.0]$ jps
2019 NodeManager
2195 Jps
1945 DataNode
[[email protected] hadoop-2.6.0]$
2、再启动HBase即可。
[[email protected] hadoop-2.6.0]$ cd ..
[[email protected] app]$ cd hbase-1.2.3
[[email protected] 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
[[email protected] hbase-1.2.3]$ jps
3201 Jps
2281 SecondaryNameNode
2951 HQuorumPeer
2124 NameNode
2430 ResourceManager
3013 HMaster
[[email protected] hbase-1.2.3]$
[[email protected] hadoop-2.6.0]$ jps
2336 HRegionServer
2003 NodeManager
2396 Jps
2257 HQuorumPeer
1928 DataNode
[[email protected] hadoop-2.6.0]$
[[email protected] hadoop-2.6.0]$ jps
2019 NodeManager
2254 HQuorumPeer
2451 Jps
2333 HRegionServer
1945 DataNode
[[email protected] hadoop-2.6.0]$
进入hbase shell啊,只有HadoopMaster才可进,
[[email protected] 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>
[[email protected] hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[[email protected] hadoop-2.6.0]$
[[email protected] hadoop-2.6.0]$ hbase shell
-bash: hbase: command not found
[[email protected] hadoop-2.6.0]$
退出hbase shell啊
hbase(main):001:0> exit
[[email protected] hbase-1.2.3]$
以上是关于Hbase自带zookeeper路径的主要内容,如果未能解决你的问题,请参考以下文章
HBase的单节点集群详细启动步骤(分为Zookeeper自带还是外装)
HBase的单节点集群详细启动步骤(分为Zookeeper自带还是外装)
HBase的多节点集群详细启动步骤(3或5节点)(分为Zookeeper自带还是外装)