先说结论:
1.配置DNS(略),正反解析都要配置
hadoop.security.dns.interface
hadoop.security.dns.nameserver
- 原来集群上使用hosts文件的方法进行的域名映射,每次增加机器,或者新的业务(比如spark-sreaming新增加一个kafka读取实例,就要在全体集群上的nm节点上增加对应的hosts)。也曾经想过synchosts文件,但是总感觉有点有点问题。
- 因为配置每个机器上的host比较麻烦,所以使用了dns。因为有一台集群hosts中文件没有配置正确,hosts的解析内容和hostname没有对应正确,差了一个字符,kerberos一直报错。检查了好多次配置都没发现问题的原因(其实是host文件中有两个记录,前面一条是错误的配置)。
- 问题解决后留下了一个疑问, 为什么一定要在hosts中加入正确的域名配置才行,明明已经在dns中配置了正确的解析呢?正好有这个报错日志,可以去看看这个原因是什么
2019-03-13 23:38:41,147 WARN org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:yarn/node1@aliyun.com (auth:KERBEROS) cause:java.io.IOException: java.lang.IllegalArgumentException: Server has invalid Kerb eros principal: yarn/node1@aliyun.com, expecting: yarn/192.167.1.2@aliyun.com 2019-03-13 23:38:41,152 INFO org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider: Failing over to rm127 2019-03-13 23:38:41,155 WARN org.apache.hadoop.ipc.Client: Failed to connect to server: node0/192.167.1.246 :8031: retries get failed due to exceeded maximum allowed retries number: 0 java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(N