节点/hbase不在zookeeper中

wsxa1bj1  于 2021-06-03  发布在  Hadoop
关注(0)|答案(5)|浏览(517)

我是一个hadoop新手,尝试以伪分布式模式安装hbase,版本hbase-0.98.10.1-hadoop1-bin和hadoop2.5.2。我无法添加表。
尝试创建表时继续出现以下错误:

client.HConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

在多次(大约50次)显示错误后,最终给出的错误如下:

ERROR: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

日志文件的最新条目是:

2015-02-23 16:38:39,456 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:3017)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:186)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:135)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:3031)

Caused by: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4
at org.apache.hadoop.ipc.Client.call(Client.java:1113)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:229)
at com.sun.proxy.$Proxy8.getProtocolVersion(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:85)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:62)
at com.sun.proxy.$Proxy8.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.checkVersion(RPC.java:422)
at org.apache.hadoop.hdfs.DFSClient.createNamenode(DFSClient.java:183)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:281)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:245)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:100)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1446)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:67)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1464)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:263)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:942)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:533)
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:534)
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:3012)
... 5 more

hdbase站点配置文件:

<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/Hbase/zookeeper</value>
</property>
<property>
<name>hbase.cluster.distributed</name>  
<value>true</value>
</property> 
</configuration>

jps的输出为:

7584 Main
8532 HQuorumPeer
4435 SecondaryNameNode
4880 NodeManager
4269 DataNode
7735 FsShell
4592 ResourceManager
4141 NameNode
9128 Jps
3147 ZKServerTool
3651 HRegionServer
2992 HMaster

可能的错误是什么?感谢您的帮助。

yfwxisqw

yfwxisqw1#

这意味着zookeeper没有节点'/hbase',因此在zookeeper中创建一个节点名'/hbase'。转到zkcli并运行'create/hbase''命令。

n3schb8v

n3schb8v2#

我在talend中使用它,当我在hadoop集群中添加hbase连接时,步骤2/2,我在hadoop集群中选择repository,当我写入服务器和端口(默认2181)时,点击按钮“check”,系统提示:
连接失败。必须更改数据库设置。原因:org.apache.hadoop.hbase.masternotrunningexception:节点/hbase不在zookeeper中。应该是大师写的。检查“zookeeper.znode.parent”中配置的值。可能与主服务器中配置的不匹配
然后,需要添加hadoop属性,单击按钮并添加到属性
zookeeper.znode.parent=/hbase unsecure单击“确定”,然后单击“检查”,系统提示成功。

hof1towb

hof1towb3#

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://master:54310/hbase</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/usr/local/Hbase/zookeeper</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
     <property>
        <name>zookeeper.znode.parent</name>
        <value>/hbase-unsecure</value>
    </property>
    <property>
         <name>hbase.zookeeper.quorum</name>
         <value>localhost</value>
    </property>
    <property>
         <name>dfs.replication</name>
         <value>1</value>
    </property>
    <property>
         <name>hbase.zookeeper.quorum</name>
         <value>localhost</value>
    </property>
    <property>
        <name>hbase.master</name> 
        <value>hadoop-master:60000</value>
        </property>
</configuration>

确保zookeeper应该是start,datadir应该存在。

42fyovps

42fyovps4#

它只是在使用了不同的hbase版本之后才起作用。我使用的是hbase-0.98.10.1-hadoop1-bin,它与我的hadoop2.5.2不兼容,因此我将hbase版本更改为hbase-x.xx.xx.x-hadoop2-bin(它与hadoop2.x兼容),并遵循apache的安装步骤。谢谢大家。。

u0njafvf

u0njafvf5#

上面的答案是正确的,但要长一点。我可以通过在hbase-site.xml(使用hbase-1.2.1)中添加以下属性来解决这个问题

<property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/mnt/data/zookeeper</value>
</property>

我也不必创建/mnt/data/zookeeper。由于我使用hbase作为一个独立的,我没有运行zookeeper事实上它给了一个错误,当我这样做
完整的hbase-site.xml配置文件如下所示

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>file:///mnt/data/hbase</value>
    </property>
   <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/mnt/data/zookeeper</value>
   </property>
</configuration>

相关问题