HBase单机模式安装趟坑

今天在本地虚拟机环境上,安装了Hbase的单机模式,期间遇到几个异常情况,现记录下遇到的异常及解决办法:

1.本地单机部署hbase,想要使用独立zookeeper,不使用自带的

把hbase.cluster.distributed设置为false,也就是让hbase以standalone模式运行时,依然会去启动自带的zookeeper

所以要做如下设置,值为true

vim conf/hbase-site.xml

 hbase.cluster.distributed

true 

2.启动hbase后发现,HMaster在启动后几秒内自动关闭,HRegionServer运行正常

[localhost:16000.activeMasterManager] master.HMaster: Failed to become active master

java.net.ConnectException: Call From localhost/192.168.75.132 to localhost:8030 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at org.apache.hadoop.ipc.Client.call(Client.java:1382)

        ... 29 more

2019-10-23 14:18:25,062 FATAL [localhost:16000.activeMasterManager] master.HMaster: Unhandled exception. Starting shutdown.

java.net.ConnectException: Call From localhost/192.168.75.132 to localhost:8030 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:730)

        at org.apache.hadoop.ipc.Client.call(Client.java:1415)

        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)

从上面的日志可以看出,在连接localhost:8030时出错,我们知道8030是hdfs的默认端口,但是我们在配置hadoop集群时在core-site.xml中将hdfs的默认端口改为了9000:

    fs.defaultFS    hdfs://localhost:9000/

解决方案

在配置hbase.rootdir属性时显式指定hdfs的端口为9000,配置文件修改如下:

   

   

        hbase.rootdir

        hdfs://localhost:9000/hbase

   

接下来,重启hbase,问题解决。

3.如下异常:

java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.

hbase-site.xml增加配置 

hbase.unsafe.stream.capability.enforce

false

你可能感兴趣的:(HBase单机模式安装趟坑)