我是HBase的新手,我正在尝试找到HBase故障转移情况的解决方案。所以这里是正在发生的事情的全貌。我们有3个zookeeper节点,2个Hbase主节点和一些区域服务器。当hbase从1个主服务器故障转移到另一个主服务器时,我们已经回收了我们的服务,以便让我们的服务达到hbase,否则我们会得到ConnectionRefused异常。我不确定我们做错了什么,或者我们是否缺少任何配置或其他东西。当我们使用hbase shell时会发生同样的事情,如果发生主故障转移,那么它会开始抛出相同的错误。任何人都可以帮助我知道为什么会这样吗?仅供参考我们正在使用hbase 0.94.2
我们看到的错误如下
java.lang.reflect.UndeclaredThrowableException
$Proxy81.getHTableDescriptors(Unknown Source)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHTableDescriptor(HConnectionManager.java:1834)
org.apache.hadoop.hbase.client.HTable.getTableDescriptor(HTable.java:440)
root cause
java.net.ConnectException: Connection refused
sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:207)
org.apache.hadoop.net.NetUtils.connect(NetUtils.java:525)
org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:416)
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:462)
org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1150)
org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:1000)
org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:150)
$Proxy81.getHTableDescriptors(Unknown Source)
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHTableDescriptor(HConnectionManager.java:1834)
org.apache.hadoop.hbase.client.HTable.getTableDescriptor(HTable.java:440)
这是配置。我用zk
替换了zookeeper仲裁<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>dfs.client.read.shortcircuit</name>
<value>false</value>
</property>
<property>
<name>my.property</name>
<value>value</value>
</property>
<property>
<name>hbase.regionserver.handler.count</name>
<value>30</value>
</property>
<property>
<name>hbase.hregion.max.filesize</name>
<value>10737418240</value>
</property>
<property>
<name>hbase.client.pause</name>
<value>30000</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs-path</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>zk1,zk2,zk3</value>
</property>
<property>
<name>hbase.client.keyvalue.maxsize</name>
<value>209715200</value>
</property>
<property>
<name>hbase.regionserver.codecs</name>
<value>snappy,lzo,gz</value>
</property>
<property>
<name>hbase.hstore.blockingStoreFiles</name>
<value>25</value>
</property>
<property>
<name>hbase.client.scanner.caching</name>
<value>100</value>
</property>
<property>
<name>hbase.replication</name>
<value>true</value>
</property>
<property>
<name>hbase.snapshot.enabled</name>
<value>true</value>
</property>
<property>
<name>hbase.hregion.majorcompaction</name>
<value>0</value>
</property>
<property>
<name>hbase.regionserver.checksum.verify</name>
<value>true</value>
</property>
<property>
<name>hbase.bulkload.staging.dir</name>
<value>/tmp/hbase-staging</value>
</property>
<property>
<name>hbase.coprocessor.region.classes</name>
<value>org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint</value>
</property>
<property>
<name>hbase.regionserver.region.split.policy</name>
<value>org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy</value>
</property>
<property>
<name>hbase.client.retries.number</name>
<value>3</value>
</property>
<property>
<name>zookeeper.recovery.retry</name>
<value>1</value>
</property>
</configuration>