У меня есть две машины two linux
одна из которых является master machine(192.168.8.174)
а другая - slave1 machine(192.168.8.173)
. Я успешно установил и настроил Hadoop 2.6.0
в полностью распределенном режиме. Выход Hadoop также идет отлично. Я установил и настроил HBase 1.0
.i использовал hbase default zookeeper
.i didn't installed separate zookeeper
.Когда я запускаю hbase, он показывает ошибку в hbase log file
hbase, как показано ниже
2015-03-21 09:23:15,676 INFO [main] zookeeper.ZooKeeper: Client environment:user.name=master
2015-03-21 09:23:15,676 INFO [main] zookeeper.ZooKeeper: Client environment:user.home=/home/master
2015-03-21 09:23:15,676 INFO [main] zookeeper.ZooKeeper: Client environment:user.dir=/home/master
2015-03-21 09:23:15,682 INFO [main] zookeeper.ZooKeeper: Initiating client connection, connectString=slave1:2222,master:2222 sessionTimeout=90000 watcher=master:160200x0, quorum=slave1:2222,master:2222, baseZNode=/hbase
2015-03-21 09:23:15,762 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:15,783 WARN [main-SendThread(master:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:15,899 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:15,900 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:15,907 WARN [main] zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=slave1:2222,master:2222, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
2015-03-21 09:23:15,908 INFO [main] util.RetryCounter: Sleeping 1000ms before retry #0...
2015-03-21 09:23:17,006 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:17,007 WARN [main-SendThread(master:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:17,108 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:17,108 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:17,109 WARN [main] zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=slave1:2222,master:2222, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
2015-03-21 09:23:17,109 INFO [main] util.RetryCounter: Sleeping 2000ms before retry #1...
2015-03-21 09:23:18,210 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:18,210 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:18,226 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:18,793 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:18,795 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:20,568 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:20,570 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:20,572 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:20,672 WARN [main] zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=slave1:2222,master:2222, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
2015-03-21 09:23:20,672 INFO [main] util.RetryCounter: Sleeping 4000ms before retry #2...
2015-03-21 09:23:21,418 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:21,419 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:23,116 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:23,116 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:23,118 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:23,851 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:23,852 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:24,961 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:24,962 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:24,964 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:25,064 WARN [main] zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=slave1:2222,master:2222, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
2015-03-21 09:23:25,064 INFO [main] util.RetryCounter: Sleeping 8000ms before retry #3...
2015-03-21 09:23:25,992 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:25,994 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:28,070 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:28,071 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:28,072 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:28,344 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:28,345 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:29,843 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:29,844 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:29,845 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:30,925 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:30,926 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:32,241 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:32,242 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:32,243 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:32,445 INFO [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.8.173:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:32,446 WARN [main-SendThread(slave1:2222)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-03-21 09:23:34,335 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Opening socket connection to server master/192.168.8.174:2222. Will not attempt to authenticate using SASL (unknown error)
2015-03-21 09:23:34,337 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Socket connection established to master/192.168.8.174:2222, initiating session
2015-03-21 09:23:34,339 INFO [main-SendThread(master:2222)] zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-03-21 09:23:34,440 WARN [main] zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper, quorum=slave1:2222,master:2222, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
2015-03-21 09:23:34,440 ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts
2015-03-21 09:23:34,440 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1982)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:198)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1996)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.createNonSequential(RecoverableZooKeeper.java:512)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.create(RecoverableZooKeeper.java:491)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.createWithParents(ZKUtil.java:1252)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.createWithParents(ZKUtil.java:1230)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.createBaseZNodes(ZooKeeperWatcher.java:174)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:167)
at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:531)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:333)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1977)
... 5 more
но когда я использую jps
он работает в командной строке, как показано ниже
master machine slave1 machine
HMaster HQuorumpeer
HQuorumpeer RegionServer
HRegionServer
мои hbase configuration files
главный компьютер - hbase-site.xml
<configuration>
<property>
<name>hbase.master</name>
<value>master:9000</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/master/hbase/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master,slave1</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
</configuration>
машина slave1 - hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
а также
master /etc/hosts
192.168.8.174 master
192.168.8.173 slave1
slave1 /etc/hosts
192.168.8.174 master
192.168.8.173 slave1
и я проверил оба логических для HBASE_MANAGES_ZK в true или false в hbase-env.sh, но все же я не смог найти
я не знаю, что я ошибаюсь, дать какое-то решение ..