生产环境Tomcat服务器访问HDFS报错

下载Tomcat日志文件 runtime_info.log查看信息:

[WARN ][19-01-11 18:07:19][http-nio-8080-exec-3][*]Exception encountered while connecting to the server : java.lang.IllegalArgumentException: Server has invalid Kerberos principal: hdfs/[email protected]
[WARN ][19-01-11 18:07:19][http-nio-8080-exec-3][*]Exception while invoking class org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo over svldl043.csvw.com/10.122.3.61:8020. Not retrying because failovers (15) exceeded maximum allowed (15)
java.io.IOException: Failed on local exception: java.io.IOException: java.lang.IllegalArgumentException: Server has invalid Kerberos principal: hdfs/[email protected]; Host Details : local host is: "svlvm128/10.122.31.36"; destination host is: "test043.lhx.com":8020; 
	at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772)
	at org.apache.hadoop.ipc.Client.call(Client.java:1472)
	at org.apache.hadoop.ipc.Client.call(Client.java:1399)
	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
	at com.sun.proxy.$Proxy108.getFileInfo(Unknown Source)
	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:752)
	at sun.reflect.GeneratedMethodAccessor224.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
	at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
	at com.sun.proxy.$Proxy109.getFileInfo(Unknown Source)

同样代码部署到测试环境是OK的,初步判断是集群解析问题

#namenode
10.122.3.60 test042.lhx.com
10.122.3.61 test043.lhx.com
10.122.3.62 test044.lhx.com
10.122.3.63 test045.lhx.com

把集群IP映射配置到Tomcat服务器中即可。

猜你喜欢

转载自blog.csdn.net/lhxsir/article/details/86473855
今日推荐