use of org.apache.hadoop.yarn.ipc.YarnRPC in project hadoop by apache.
the class AMRMProxyService method serviceStart.
@Override
protected void serviceStart() throws Exception {
LOG.info("Starting AMRMProxyService");
Configuration conf = getConfig();
YarnRPC rpc = YarnRPC.create(conf);
UserGroupInformation.setConfiguration(conf);
this.listenerEndpoint = conf.getSocketAddr(YarnConfiguration.AMRM_PROXY_ADDRESS, YarnConfiguration.DEFAULT_AMRM_PROXY_ADDRESS, YarnConfiguration.DEFAULT_AMRM_PROXY_PORT);
Configuration serverConf = new Configuration(conf);
serverConf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, SaslRpcServer.AuthMethod.TOKEN.toString());
int numWorkerThreads = serverConf.getInt(YarnConfiguration.AMRM_PROXY_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_AMRM_PROXY_CLIENT_THREAD_COUNT);
this.secretManager = new AMRMProxyTokenSecretManager(serverConf);
this.secretManager.start();
this.server = rpc.getServer(ApplicationMasterProtocol.class, this, listenerEndpoint, serverConf, this.secretManager, numWorkerThreads);
this.server.start();
LOG.info("AMRMProxyService listening on address: " + this.server.getListenerAddress());
super.serviceStart();
}
use of org.apache.hadoop.yarn.ipc.YarnRPC in project hadoop by apache.
the class NMCollectorService method serviceStart.
@Override
protected void serviceStart() throws Exception {
Configuration conf = getConfig();
InetSocketAddress collectorServerAddress = conf.getSocketAddr(YarnConfiguration.NM_BIND_HOST, YarnConfiguration.NM_COLLECTOR_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_PORT);
Configuration serverConf = new Configuration(conf);
// TODO Security settings.
YarnRPC rpc = YarnRPC.create(conf);
server = rpc.getServer(CollectorNodemanagerProtocol.class, this, collectorServerAddress, serverConf, this.context.getNMTokenSecretManager(), conf.getInt(YarnConfiguration.NM_COLLECTOR_SERVICE_THREAD_COUNT, YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_THREAD_COUNT));
server.start();
collectorServerAddress = conf.updateConnectAddr(YarnConfiguration.NM_BIND_HOST, YarnConfiguration.NM_COLLECTOR_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_ADDRESS, server.getListenerAddress());
// start remaining services
super.serviceStart();
LOG.info("NMCollectorService started at " + collectorServerAddress);
}
use of org.apache.hadoop.yarn.ipc.YarnRPC in project hadoop by apache.
the class HistoryClientService method serviceStart.
protected void serviceStart() throws Exception {
Configuration conf = getConfig();
YarnRPC rpc = YarnRPC.create(conf);
initializeWebApp(conf);
InetSocketAddress address = conf.getSocketAddr(JHAdminConfig.MR_HISTORY_BIND_HOST, JHAdminConfig.MR_HISTORY_ADDRESS, JHAdminConfig.DEFAULT_MR_HISTORY_ADDRESS, JHAdminConfig.DEFAULT_MR_HISTORY_PORT);
server = rpc.getServer(HSClientProtocol.class, protocolHandler, address, conf, jhsDTSecretManager, conf.getInt(JHAdminConfig.MR_HISTORY_CLIENT_THREAD_COUNT, JHAdminConfig.DEFAULT_MR_HISTORY_CLIENT_THREAD_COUNT));
// Enable service authorization?
if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) {
server.refreshServiceAcl(conf, new ClientHSPolicyProvider());
}
server.start();
this.bindAddress = conf.updateConnectAddr(JHAdminConfig.MR_HISTORY_BIND_HOST, JHAdminConfig.MR_HISTORY_ADDRESS, JHAdminConfig.DEFAULT_MR_HISTORY_ADDRESS, server.getListenerAddress());
LOG.info("Instantiated HistoryClientService at " + this.bindAddress);
super.serviceStart();
}
use of org.apache.hadoop.yarn.ipc.YarnRPC in project hadoop by apache.
the class ApplicationHistoryClientService method serviceStart.
protected void serviceStart() throws Exception {
Configuration conf = getConfig();
YarnRPC rpc = YarnRPC.create(conf);
InetSocketAddress address = conf.getSocketAddr(YarnConfiguration.TIMELINE_SERVICE_BIND_HOST, YarnConfiguration.TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_PORT);
Preconditions.checkArgument(conf.getInt(YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_CLIENT_THREAD_COUNT) > 0, "%s property value should be greater than zero", YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT);
server = rpc.getServer(ApplicationHistoryProtocol.class, this, address, conf, null, conf.getInt(YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_CLIENT_THREAD_COUNT));
// Enable service authorization?
if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) {
refreshServiceAcls(conf, new TimelinePolicyProvider());
}
server.start();
this.bindAddress = conf.updateConnectAddr(YarnConfiguration.TIMELINE_SERVICE_BIND_HOST, YarnConfiguration.TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ADDRESS, server.getListenerAddress());
LOG.info("Instantiated ApplicationHistoryClientService at " + this.bindAddress);
super.serviceStart();
}
use of org.apache.hadoop.yarn.ipc.YarnRPC in project hadoop by apache.
the class MRDelegationTokenRenewer method instantiateHistoryProxy.
protected MRClientProtocol instantiateHistoryProxy(final Configuration conf, final InetSocketAddress hsAddress) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Connecting to MRHistoryServer at: " + hsAddress);
}
final YarnRPC rpc = YarnRPC.create(conf);
UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
return currentUser.doAs(new PrivilegedAction<MRClientProtocol>() {
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class, hsAddress, conf);
}
});
}
Aggregations