|
@@ -19,6 +19,7 @@
|
|
|
package org.apache.hadoop.yarn.server.resourcemanager;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.net.InetSocketAddress;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.BlockingQueue;
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
@@ -894,8 +895,9 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
|
|
}
|
|
|
|
|
|
protected void doSecureLogin() throws IOException {
|
|
|
+ InetSocketAddress socAddr = getBindAddress(conf);
|
|
|
SecurityUtil.login(this.conf, YarnConfiguration.RM_KEYTAB,
|
|
|
- YarnConfiguration.RM_PRINCIPAL);
|
|
|
+ YarnConfiguration.RM_PRINCIPAL, socAddr.getHostName());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1042,4 +1044,17 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
|
|
addIfService(rmDispatcher);
|
|
|
rmContext.setDispatcher(rmDispatcher);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Retrieve RM bind address from configuration
|
|
|
+ *
|
|
|
+ * @param conf
|
|
|
+ * @return InetSocketAddress
|
|
|
+ */
|
|
|
+public static InetSocketAddress getBindAddress(Configuration conf) {
|
|
|
+ return conf.getSocketAddr(YarnConfiguration.RM_ADDRESS,
|
|
|
+ YarnConfiguration.DEFAULT_RM_ADDRESS,
|
|
|
+ YarnConfiguration.DEFAULT_RM_PORT);
|
|
|
+ }
|
|
|
}
|