Caused by: org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not

1.问题描述

使用 Java api连接 hbase 发生报错,但是可以测试连接可以连上,并且能打印出连接

报错信息如下

org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=16, exceptions:
2023-09-14T08:04:35.289Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:35.416Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:35.645Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:35.974Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:36.509Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:37.543Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:39.579Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:43.619Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:04:53.746Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:05:03.846Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:05:13.977Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:05:24.106Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:05:44.268Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:06:04.409Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:06:24.477Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
2023-09-14T08:06:44.682Z, RpcRetryingCaller{globalStartTime=1694678674829, pause=100, maxAttempts=16}, org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179

	at org.apache.hadoop.hbase.client.RpcRetryingCallerImpl.callWithRetries(RpcRetryingCallerImpl.java:145)
	at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3014)
	at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3006)
	at org.apache.hadoop.hbase.client.HBaseAdmin.createNamespaceAsync(HBaseAdmin.java:2149)
	at org.apache.hadoop.hbase.client.Admin.createNamespace(Admin.java:1726)
	at org.example.AppTest.createNamespace(AppTest.java:81)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
	at org.apache.hadoop.hbase.client.ConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionImplementation.java:1235)
	at org.apache.hadoop.hbase.client.ConnectionImplementation.getKeepAliveMasterService(ConnectionImplementation.java:1294)
	at org.apache.hadoop.hbase.client.ConnectionImplementation.getMaster(ConnectionImplementation.java:1283)
	at org.apache.hadoop.hbase.client.MasterCallable.prepare(MasterCallable.java:57)
	at org.apache.hadoop.hbase.client.RpcRetryingCallerImpl.callWithRetries(RpcRetryingCallerImpl.java:105)
	... 29 more
Caused by: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.createAddr(AbstractRpcClient.java:433)
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.createBlockingRpcChannel(AbstractRpcClient.java:511)
	at org.apache.hadoop.hbase.client.ConnectionImplementation$MasterServiceStubMaker.lambda$makeStubNoRetries$0(ConnectionImplementation.java:1210)
	at org.apache.hadoop.hbase.util.ConcurrentMapUtils.computeIfAbsentEx(ConcurrentMapUtils.java:61)
	at org.apache.hadoop.hbase.client.ConnectionImplementation$MasterServiceStubMaker.makeStubNoRetries(ConnectionImplementation.java:1209)
	at org.apache.hadoop.hbase.client.ConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionImplementation.java:1229)
	... 33 more

这里的问题很容易能看出来,是反复尝试访问却访问不到

2.问题解决

这里我们主要关注一下 caused by后面的提示

Caused by: org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve iz2ze0szvj66t62cmr0u5tz,16000,1694665070179

这里的意思是找不到iz2ze0szvj66t62cmr0u5tz

这个其实是我阿里云服务器实例的名字,找不到它也容易理解,就是因为没有在本地做域名映射

在 本地的hosts文件(win 后 mac 系统)中配置服务器的 ip ,和这里报错提示的字段

39.107.***.*** iz2ze0szvj66t62cmr0u5t

当然不是云服务器报类似的错误也可按此思路找问题

你可能感兴趣的:(apache,hadoop,hbase)