問題現(xiàn)象
HDFS Client拋出如下異常:
java.net.UnknownHostException: NAMESERVICE
at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:374)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:312)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:178)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:665)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:601)
可能原因
Configuration實(shí)例缺乏配置項(xiàng)dfs.client.failover.proxy.provider.NAMESERVICE。
解決方案
在Configuration實(shí)例或其加載的配置文件中添加對(duì)應(yīng)配置項(xiàng)酸休。