在使用HBASE,create 'user','info'时出现:
ERROR [main]client.ConnectionManager$HConnectionImplementation: The node /hbase is not inZooKeeper. It should have been written by the master. Check the valueconfigured in 'zookeeper.znode.parent'. There could be a mismatch with the oneconfigured in the master
根据提示,缺少zookeeper.znode.parent的配置,在hbase-site.xml中增加配置,
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase-unsecure</value>
</property>
(参见:https://blog.csdn.net/mmm333zzz/article/details/51760298)
这里不明白参数的意义,继续查找,发现:
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
<description>Root ZNode for HBase in ZooKeeper. All of HBase's ZooKeeper
files that are configured with a relative path will go under this node.
By default, all of HBase's ZooKeeper file path are configured with a
relative path, so they will all go under this directory unless changed.
</description>
(参见:https://blog.csdn.net/macyang/article/details/6211141)
经过一番折腾,还是存在着问题,肯定是配置的问题呀,于是继续找跟我集群环境相似的配置,找到了如下介绍:
https://blog.csdn.net/peace1213/article/details/51336369
发现HBASE中的配置文件hbase-env.sh存在问题;
export HBASE_CLASSPATH=/usr/local/hadoop/conf
export HBASE_MANAGES_ZK=false
这两项之前没有配置,其中,HBASE_CLASSPATH指向存放有Hadoop配置文件的目录,这样HBase可以找到HDFS的配置信息,由于本文Hadoop和HBase部署在相同的物理节点,所以就指向了Hadoop安装路径下的conf目录。HBASE_MANAGES_ZK=false指示HBase使用已有的Zookeeper而不是自带的。
将配置文件拷贝覆盖原有节点,重新启动HBASE:
start-hbase.sh
查看jps进程,发现主节点和从节点出现HMaster和HregionServer,
继续执行:hbase shell
出现hbase>
创建:create 'user','info'----------------这次出现错误:ERROR :Master is initializing;
同步时间后,重新执行该步骤,出现ERROR:znode data =null;
再次执行,又出现ERROR :Master is initializing
(与如下链接中的问题相同:https://blog.csdn.net/liulang12580/article/details/77841699)
查看hbase 的log,发现:
org.apache.hadoop.hbase.ClockOutOfSyncException: Server node4,60020,1405560498057 has been rejected; Reported time is too far out of sync with master. Time difference of 28804194ms > max allowed of 30000ms
查看node4 的时间,发现是竟然和集群其他机器差了整整一天。(内网电脑还未配置好ntpdate,报错this exceeds the compiled library version)
手动调整时间,重新启动hbase,
查看node4的进程,出现了HRegionServer
执行 create 'user','info'
成功。