Search in sources :

Example 16 with YarnRPC

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();
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) ApplicationMasterProtocol(org.apache.hadoop.yarn.api.ApplicationMasterProtocol) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC)

Example 17 with YarnRPC

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);
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) CollectorNodemanagerProtocol(org.apache.hadoop.yarn.server.api.CollectorNodemanagerProtocol) InetSocketAddress(java.net.InetSocketAddress) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC)

Example 18 with YarnRPC

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();
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) InetSocketAddress(java.net.InetSocketAddress) HSClientProtocol(org.apache.hadoop.mapreduce.v2.api.HSClientProtocol) ClientHSPolicyProvider(org.apache.hadoop.mapreduce.v2.app.security.authorize.ClientHSPolicyProvider) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC)

Example 19 with YarnRPC

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();
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) TimelinePolicyProvider(org.apache.hadoop.yarn.server.timeline.security.authorize.TimelinePolicyProvider) InetSocketAddress(java.net.InetSocketAddress) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) ApplicationHistoryProtocol(org.apache.hadoop.yarn.api.ApplicationHistoryProtocol)

Example 20 with YarnRPC

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);
        }
    });
}
Also used : YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) UserGroupInformation(org.apache.hadoop.security.UserGroupInformation) MRClientProtocol(org.apache.hadoop.mapreduce.v2.api.MRClientProtocol)

Aggregations

YarnRPC (org.apache.hadoop.yarn.ipc.YarnRPC)54 Configuration (org.apache.hadoop.conf.Configuration)39 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)38 InetSocketAddress (java.net.InetSocketAddress)34 Test (org.junit.Test)18 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)14 IOException (java.io.IOException)13 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)12 NodeId (org.apache.hadoop.yarn.api.records.NodeId)12 ApplicationClientProtocol (org.apache.hadoop.yarn.api.ApplicationClientProtocol)8 ContainerManagementProtocol (org.apache.hadoop.yarn.api.ContainerManagementProtocol)8 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)8 HashMap (java.util.HashMap)7 Server (org.apache.hadoop.ipc.Server)7 MRClientProtocol (org.apache.hadoop.mapreduce.v2.api.MRClientProtocol)7 ApplicationMasterProtocol (org.apache.hadoop.yarn.api.ApplicationMasterProtocol)7 RegisterApplicationMasterRequest (org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest)7 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)7 RMApp (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp)7 RMAppAttempt (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt)7