Search in sources :

Example 1 with ApplicationHistoryServer

use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer in project hadoop by apache.

the class TestTimelineWebServicesWithSSL method setupServer.

@BeforeClass
public static void setupServer() throws Exception {
    conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
    conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE, MemoryTimelineStore.class, TimelineStore.class);
    conf.set(YarnConfiguration.YARN_HTTP_POLICY_KEY, "HTTPS_ONLY");
    conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 1.0f);
    File base = new File(BASEDIR);
    FileUtil.fullyDelete(base);
    base.mkdirs();
    keystoresDir = new File(BASEDIR).getAbsolutePath();
    sslConfDir = KeyStoreTestUtil.getClasspathDir(TestTimelineWebServicesWithSSL.class);
    KeyStoreTestUtil.setupSSLConfig(keystoresDir, sslConfDir, conf, false);
    conf.addResource("ssl-server.xml");
    conf.addResource("ssl-client.xml");
    timelineServer = new ApplicationHistoryServer();
    timelineServer.init(conf);
    timelineServer.start();
    store = timelineServer.getTimelineStore();
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) ApplicationHistoryServer(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 2 with ApplicationHistoryServer

use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer in project hadoop by apache.

the class TestTimelineAuthenticationFilter method setup.

@BeforeClass
public static void setup() {
    try {
        testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
        testMiniKDC.start();
        testMiniKDC.createPrincipal(httpSpnegoKeytabFile, HTTP_USER + "/localhost");
    } catch (Exception e) {
        assertTrue("Couldn't setup MiniKDC", false);
    }
    try {
        testTimelineServer = new ApplicationHistoryServer();
        conf = new Configuration(false);
        conf.setStrings(TimelineAuthenticationFilterInitializer.PREFIX + "type", "kerberos");
        conf.set(TimelineAuthenticationFilterInitializer.PREFIX + KerberosAuthenticationHandler.PRINCIPAL, httpSpnegoPrincipal);
        conf.set(TimelineAuthenticationFilterInitializer.PREFIX + KerberosAuthenticationHandler.KEYTAB, httpSpnegoKeytabFile.getAbsolutePath());
        conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
        conf.set(YarnConfiguration.TIMELINE_SERVICE_PRINCIPAL, httpSpnegoPrincipal);
        conf.set(YarnConfiguration.TIMELINE_SERVICE_KEYTAB, httpSpnegoKeytabFile.getAbsolutePath());
        conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
        conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE, MemoryTimelineStore.class, TimelineStore.class);
        conf.set(YarnConfiguration.TIMELINE_SERVICE_ADDRESS, "localhost:10200");
        conf.set(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS, "localhost:8188");
        conf.set(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_HTTPS_ADDRESS, "localhost:8190");
        conf.set("hadoop.proxyuser.HTTP.hosts", "*");
        conf.set("hadoop.proxyuser.HTTP.users", FOO_USER);
        conf.setInt(YarnConfiguration.TIMELINE_SERVICE_CLIENT_MAX_RETRIES, 1);
        if (withSsl) {
            conf.set(YarnConfiguration.YARN_HTTP_POLICY_KEY, HttpConfig.Policy.HTTPS_ONLY.name());
            File base = new File(BASEDIR);
            FileUtil.fullyDelete(base);
            base.mkdirs();
            keystoresDir = new File(BASEDIR).getAbsolutePath();
            sslConfDir = KeyStoreTestUtil.getClasspathDir(TestTimelineAuthenticationFilter.class);
            KeyStoreTestUtil.setupSSLConfig(keystoresDir, sslConfDir, conf, false);
        }
        UserGroupInformation.setConfiguration(conf);
        testTimelineServer.init(conf);
        testTimelineServer.start();
    } catch (Exception e) {
        assertTrue("Couldn't setup TimelineServer", false);
    }
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) MiniKdc(org.apache.hadoop.minikdc.MiniKdc) ApplicationHistoryServer(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer) File(java.io.File) AuthenticationException(org.apache.hadoop.security.authentication.client.AuthenticationException) AuthorizationException(org.apache.hadoop.security.authorize.AuthorizationException) BeforeClass(org.junit.BeforeClass)

Example 3 with ApplicationHistoryServer

use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer in project hadoop by apache.

the class TestSystemMetricsPublisher method setup.

@BeforeClass
public static void setup() throws Exception {
    YarnConfiguration conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
    conf.setBoolean(YarnConfiguration.SYSTEM_METRICS_PUBLISHER_ENABLED, true);
    conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE, MemoryTimelineStore.class, TimelineStore.class);
    conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STATE_STORE_CLASS, MemoryTimelineStateStore.class, TimelineStateStore.class);
    conf.setInt(YarnConfiguration.RM_SYSTEM_METRICS_PUBLISHER_DISPATCHER_POOL_SIZE, 2);
    timelineServer = new ApplicationHistoryServer();
    timelineServer.init(conf);
    timelineServer.start();
    store = timelineServer.getTimelineStore();
    metricsPublisher = new TimelineServiceV1Publisher();
    metricsPublisher.init(conf);
    metricsPublisher.start();
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) ApplicationHistoryServer(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer) BeforeClass(org.junit.BeforeClass)

Aggregations

YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)3 ApplicationHistoryServer (org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer)3 BeforeClass (org.junit.BeforeClass)3 File (java.io.File)2 Configuration (org.apache.hadoop.conf.Configuration)1 MiniKdc (org.apache.hadoop.minikdc.MiniKdc)1 AuthenticationException (org.apache.hadoop.security.authentication.client.AuthenticationException)1 AuthorizationException (org.apache.hadoop.security.authorize.AuthorizationException)1