原代码
代码一直卡着报错如下:
java.io.UncheckedI0Exception:org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the location for replica 0at org.apache.hadoop.hbase.client.ResultScanner$1.hasNext(ResultScanner.java:55)at hbase.SelectScanAllHbaseData.main(SelectScanAlTHbaseData.java:35)caused by: orgapachehadoophbase.client.RetriesExhaustedException: Can't get the location for replica 0lient.RpcRetryingCallerWlithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:332)at org .apache.hadoop .hbase.c.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.iava:153)at org.apache.hadoop.hpase.cllentat org,apachehadoop.hbaseclientscannercallablewithReplicas call(scannercallablellithReplicas . iava:58)at org.apache.hadoop.hbase.client,RocRetrvinacallerImol.caluwithoutRetries(RocRetrvinacallerImpl.java:192)at org.apache.hadoop.hbase.client.clientScanner.call(clientScanner.java:269)at org.apache.hadoop.hbase.client.clientScanner.loadCache(clientScanner.java:437)at org.apache.hadoop.hbase.client.clientScanner.nextwithSyncCache(clientScanner.java:312)at org.apache.hadoop.hbase.client.ctientScanner.next(clientScanner.java:597)at org.apache.hadoop.hbase.client.ResultScanner$1.hasNext(ResultScanner.java:531 more
Caused by: java.io.IOException:KeeperException$ConnectionLossException: KeeperErrorCode = Connectionloss for /hbase/meta-region-serverord.abacneat org.apache.hadoophbase.client,ConnectionImplementation.get(ConnectionImplementation.java:1991at org .apache .hadoop .hbase.ConnectionImplementation.locateMeta(ConnectionImplementation.iava:767)01a0n+at org.apache .hadoop .hbase..client.ConnectionImplementation.locateRegion(ConnectionImplementation,java:734)at org.apache.hadoop.hbase.client.ConnectionImplementation.relocateRegion(ConnectionImplementation.java:717)at org.apache.hadoop.hbase.client.Connectionimplementation.locateRegionInMeta(ConnectionImolementation,iava:909)at org.apache.hadoop.hbase.client.ConnectionImplementation.locateRegion(ConnectionImplementation.java:737)at org.apache.hadoophbaseclientRpcRetrvingcallerWithreadReplicas.qetRegionlocations(RocRetryingcallerwithReadReplicas.java:3259 moreCaused by: org.apache.zookeeper.KeeperException$ConnectionLossException:KeeperErrorCode = ConnectionLoss for /hbase/meta-region-server
更改代码
hbase.zookeeper.quorum:ZooKeeper集群的地址,必须进行配置,该项默认为localhost。
hbase.zookeeper.property.clientPort:默认为2181,可以不进行配置。
zookeeper.znode.parent:默认为/hbase,可以不配置。
zookeeper.session.timeout:表示RegionServer与ZooKeeper之间的会话超时时间,一旦session超时,ZooKeeper就会感知到,通知Master将对应的RegionServer移出集群,并将该RegionServer上所有Region迁移到集群中其他RegionServer