在本地调试应用调查询hbase接口时,可能会出现卡住,查不动的状况,这多半是因为自己电脑没有配置域名(hbase确保没出问题的情况下)
2022-02-18 14:05:12.546 ERROR [hconnection-0x26fddb3f-metaLookup-shared--pool2-t1] org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher 719 ::: hconnection-0x26fddb3f-0x37e7b4580dab328, quorum=192.168.2.110:2181, baseZNode=/hbase Received unexpected KeeperException, re-throwing exceptionorg.apache.hadoop.hbase.shaded.org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /hbase/meta-region-serverat org.apache.hadoop.hbase.shaded.org.apache.zookeeper.KeeperException.create(KeeperException.java:127)at org.apache.hadoop.hbase.shaded.org.apache.zookeeper.KeeperException.create(KeeperException.java:51)at org.apache.hadoop.hbase.shaded.org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1155)at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.getData(RecoverableZooKeeper.java:354)at org.apache.hadoop.hbase.zookeeper.ZKUtil.getData(ZKUtil.java:624)at org.apache.hadoop.hbase.zookeeper.metaTableLocator.getmetaRegionState(metaTableLocator.java:486)at org.apache.hadoop.hbase.zookeeper.metaTableLocator.getmetaRegionLocation(metaTableLocator.java:167)at org.apache.hadoop.hbase.zookeeper.metaTableLocator.blockUntilAvailable(metaTableLocator.java:606)at org.apache.hadoop.hbase.zookeeper.metaTableLocator.blockUntilAvailable(metaTableLocator.java:587)at org.apache.hadoop.hbase.zookeeper.metaTableLocator.blockUntilAvailable(metaTableLocator.java:560)at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getmetaRegionLocation(ZooKeeperRegistry.java:61)at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locatemeta(ConnectionManager.java:1213)at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1180)at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.relocateRegion(ConnectionManager.java:1154)at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:303)at org.apache.hadoop.hbase.client.ReversedScannerCallable.prepare(ReversedScannerCallable.java:105)at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.prepare(ScannerCallableWithReplicas.java:376)at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:135)at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:65)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)
并且进入RpcRetryingCaller这个类里debug可以发现报了UnknownHostException,这时,我们可以编辑电脑的hosts文件来解决问题。路径:C:WindowsSystem32driversetc。添加hbase地址即可(ip 域名)ip与域名中间要有空格