エラー:zookeeperからマスターアドレスを取得できません。znodeデータ== null


0

私はtwo linuxマシンが1つであり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 をインストールして設定しました.hbase didn't installed separate zookeeperを起動すると、次のhbase log fileようなエラーが表示されます

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の両方のブール値がhbase-env.shでtrueまたはfalseであることをテストしましたが、それでも見つけることができませんでした

何が間違っているのかわからない。

回答:


0

/ hbase例外のKeeperErrorCode = ConnectionLossを取得しましたが、次の構成作業は私のためです:hbase-env.shの変更:

export HBASE_MANAGES_ZK=true

ams-hbase-siteで以下を変更します。

                <configuration>
                <property> 
                <name>hbase.zookeeper.quorum</name> 
                <value>zknode1,zknode2,zknode3,zknode4</value> 
                </property>
                <property>
                <name>hbase.rootdir</name>
                <value>hdfs://localhost:8020/hbase</value>
                </property>
                <property> 
                <name>hbase.cluster.distributed</name> 
                <value>true</value> 
                </property> 
                <property>
                <name>hbase.zookeeper.property.clientPort</name>
                <value>2181</value> 
                </property>
                </configuration> 

すべてのzookeeperノードをhbase.zookeeper.quorumに追加します。

If above config not work for you then add following property in Advanced ams-hbase-security-site:
 zookeeper.znode.parent= /hbase
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.