YARN-1085. Addendum patch to address issues with the earlier patch.

svn merge --ignore-ancestry -c 1517721 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1517722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-08-26 23:01:23 +00:00
parent 922647fe26
commit ba89f8efc7
5 changed files with 22 additions and 13 deletions

View File

@ -129,6 +129,15 @@ public class JHAdminConfig {
public static final int DEFAULT_MR_HISTORY_WEBAPP_PORT = 19888; public static final int DEFAULT_MR_HISTORY_WEBAPP_PORT = 19888;
public static final String DEFAULT_MR_HISTORY_WEBAPP_ADDRESS = public static final String DEFAULT_MR_HISTORY_WEBAPP_ADDRESS =
"0.0.0.0:" + DEFAULT_MR_HISTORY_WEBAPP_PORT; "0.0.0.0:" + DEFAULT_MR_HISTORY_WEBAPP_PORT;
/**The kerberos principal to be used for spnego filter for history server*/
public static final String MR_WEBAPP_SPNEGO_USER_NAME_KEY =
MR_HISTORY_PREFIX + "webapp.spnego-principal";
/** The kerberos keytab to be used for spnego filter for history server*/
public static final String MR_WEBAPP_SPNEGO_KEYTAB_FILE_KEY =
MR_HISTORY_PREFIX + "webapp.spnego-keytab-file";
/* /*
* HS Service Authorization * HS Service Authorization
*/ */

View File

@ -153,9 +153,9 @@ public class HistoryClientService extends AbstractService {
.$for("jobhistory", HistoryClientService.class, this, "ws") .$for("jobhistory", HistoryClientService.class, this, "ws")
.with(conf) .with(conf)
.withHttpSpnegoKeytabKey( .withHttpSpnegoKeytabKey(
YarnConfiguration.JHS_WEBAPP_SPNEGO_KEYTAB_FILE_KEY) JHAdminConfig.MR_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
.withHttpSpnegoPrincipalKey( .withHttpSpnegoPrincipalKey(
YarnConfiguration.JHS_WEBAPP_SPNEGO_USER_NAME_KEY) JHAdminConfig.MR_WEBAPP_SPNEGO_USER_NAME_KEY)
.at(NetUtils.getHostPortString(bindAddress)).start(webApp); .at(NetUtils.getHostPortString(bindAddress)).start(webApp);
conf.updateConnectAddr(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS, conf.updateConnectAddr(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
webApp.getListenerAddress()); webApp.getListenerAddress());

View File

@ -214,11 +214,13 @@ public class YarnConfiguration extends Configuration {
public static final String RM_KEYTAB = public static final String RM_KEYTAB =
RM_PREFIX + "keytab"; RM_PREFIX + "keytab";
/**The kerberos principal to be used for spnego filter for RM.*/
public static final String RM_WEBAPP_SPNEGO_USER_NAME_KEY = public static final String RM_WEBAPP_SPNEGO_USER_NAME_KEY =
RM_PREFIX + "webapp.spnego-principal"; RM_PREFIX + "webapp.spnego-principal";
public static final String RM_WEBAPP_SPENGO_KEYTAB_FILE_KEY = /**The kerberos keytab to be used for spnego filter for RM.*/
RM_PREFIX + "webapp.spengo-keytab-file"; public static final String RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY =
RM_PREFIX + "webapp.spnego-keytab-file";
/** How long to wait until a container is considered dead.*/ /** How long to wait until a container is considered dead.*/
public static final String RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS = public static final String RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS =
@ -615,9 +617,11 @@ public class YarnConfiguration extends Configuration {
public static final String NM_USER_HOME_DIR = public static final String NM_USER_HOME_DIR =
NM_PREFIX + "user-home-dir"; NM_PREFIX + "user-home-dir";
/**The kerberos principal to be used for spnego filter for NM.*/
public static final String NM_WEBAPP_SPNEGO_USER_NAME_KEY = public static final String NM_WEBAPP_SPNEGO_USER_NAME_KEY =
NM_PREFIX + "webapp.spnego-principal"; NM_PREFIX + "webapp.spnego-principal";
/**The kerberos keytab to be used for spnego filter for NM.*/
public static final String NM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY = public static final String NM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY =
NM_PREFIX + "webapp.spnego-keytab-file"; NM_PREFIX + "webapp.spnego-keytab-file";
@ -750,12 +754,6 @@ public class YarnConfiguration extends Configuration {
// Other Configs // Other Configs
//////////////////////////////// ////////////////////////////////
public static final String JHS_WEBAPP_SPNEGO_USER_NAME_KEY =
"jobhistoryserver.webapp.spnego-principal";
public static final String JHS_WEBAPP_SPNEGO_KEYTAB_FILE_KEY =
"jobhistoryserver.webapp.spnego-keytab-file";
/** /**
* The interval of the yarn client's querying application state after * The interval of the yarn client's querying application state after
* application submission. The unit is millisecond. * application submission. The unit is millisecond.

View File

@ -217,11 +217,13 @@ public class WebApps {
{ {
if (UserGroupInformation.isSecurityEnabled()) { if (UserGroupInformation.isSecurityEnabled()) {
boolean initSpnego = true; boolean initSpnego = true;
if (spnegoPrincipalKey == null || spnegoPrincipalKey.isEmpty()) { if (spnegoPrincipalKey == null
|| conf.get(spnegoPrincipalKey, "").isEmpty()) {
LOG.warn("Principal for spnego filter is not set"); LOG.warn("Principal for spnego filter is not set");
initSpnego = false; initSpnego = false;
} }
if (spnegoKeytabKey == null || spnegoKeytabKey.isEmpty()) { if (spnegoKeytabKey == null
|| conf.get(spnegoKeytabKey, "").isEmpty()) {
LOG.warn("Keytab for spnego filter is not set"); LOG.warn("Keytab for spnego filter is not set");
initSpnego = false; initSpnego = false;
} }

View File

@ -584,7 +584,7 @@ public class ResourceManager extends CompositeService implements Recoverable {
.withHttpSpnegoPrincipalKey( .withHttpSpnegoPrincipalKey(
YarnConfiguration.RM_WEBAPP_SPNEGO_USER_NAME_KEY) YarnConfiguration.RM_WEBAPP_SPNEGO_USER_NAME_KEY)
.withHttpSpnegoKeytabKey( .withHttpSpnegoKeytabKey(
YarnConfiguration.RM_WEBAPP_SPENGO_KEYTAB_FILE_KEY) YarnConfiguration.RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
.at(this.conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS, .at(this.conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS,
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS)); YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS));
String proxyHostAndPort = YarnConfiguration.getProxyHostAndPort(conf); String proxyHostAndPort = YarnConfiguration.getProxyHostAndPort(conf);