/** * Start proxy server. * * @return proxy server instance. */ protected static WebAppProxyServer startServer(Configuration configuration) throws Exception { WebAppProxyServer proxy = new WebAppProxyServer(); ShutdownHookManager.get().addShutdownHook( new CompositeServiceShutdownHook(proxy), SHUTDOWN_HOOK_PRIORITY); proxy.init(configuration); proxy.start(); return proxy; }
/** * Log in as the Kerberose principal designated for the proxy * @param conf the configuration holding this information in it. * @throws IOException on any error. */ protected void doSecureLogin(Configuration conf) throws IOException { InetSocketAddress socAddr = getBindAddress(conf); SecurityUtil.login(conf, YarnConfiguration.PROXY_KEYTAB, YarnConfiguration.PROXY_PRINCIPAL, socAddr.getHostName()); }
@Override protected void serviceInit(Configuration conf) throws Exception { Configuration config = new YarnConfiguration(conf); doSecureLogin(conf); proxy = new WebAppProxy(); addService(proxy); super.serviceInit(config); }
@Before public void setUp() throws Exception { YarnConfiguration conf = new YarnConfiguration(); conf.set(YarnConfiguration.PROXY_ADDRESS, proxyAddress); webAppProxy = new WebAppProxyServer(); webAppProxy.init(conf); }
@Test public void testStart() { assertEquals(STATE.INITED, webAppProxy.getServiceState()); webAppProxy.start(); for (Service service : webAppProxy.getServices()) { if (service instanceof WebAppProxy) { assertEquals(((WebAppProxy) service).getBindAddress(), proxyAddress); } } assertEquals(STATE.STARTED, webAppProxy.getServiceState()); }
public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler()); StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG); try { YarnConfiguration configuration = new YarnConfiguration(); new GenericOptionsParser(configuration, args); WebAppProxyServer proxyServer = startServer(configuration); proxyServer.proxy.join(); } catch (Throwable t) { ExitUtil.terminate(-1, t); } }
conf.set(YarnConfiguration.PROXY_ADDRESS, "localhost:9099"); try { mainServer = WebAppProxyServer.startServer(conf); int counter = 20; } finally { if (mainServer != null) { mainServer.stop();
@Before public void setUp() throws Exception { YarnConfiguration conf = new YarnConfiguration(); conf.set(YarnConfiguration.PROXY_ADDRESS, proxyAddress); webAppProxy = new WebAppProxyServer(); webAppProxy.init(conf); }
@Test public void testStart() { assertEquals(STATE.INITED, webAppProxy.getServiceState()); webAppProxy.start(); for (Service service : webAppProxy.getServices()) { if (service instanceof WebAppProxy) { assertEquals(((WebAppProxy) service).getBindAddress(), proxyAddress); } } assertEquals(STATE.STARTED, webAppProxy.getServiceState()); }
public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler()); StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG); try { YarnConfiguration configuration = new YarnConfiguration(); new GenericOptionsParser(configuration, args); WebAppProxyServer proxyServer = startServer(configuration); proxyServer.proxy.join(); } catch (Throwable t) { ExitUtil.terminate(-1, t); } }
conf.set(YarnConfiguration.PROXY_ADDRESS, "localhost:9099"); try { mainServer = WebAppProxyServer.startServer(conf); int counter = 20; } finally { if (mainServer != null) { mainServer.stop();
/** * Start proxy server. * * @return proxy server instance. */ protected static WebAppProxyServer startServer(Configuration configuration) throws Exception { WebAppProxyServer proxy = new WebAppProxyServer(); ShutdownHookManager.get().addShutdownHook( new CompositeServiceShutdownHook(proxy), SHUTDOWN_HOOK_PRIORITY); proxy.init(configuration); proxy.start(); return proxy; }
@Override protected void serviceInit(Configuration conf) throws Exception { Configuration config = new YarnConfiguration(conf); doSecureLogin(conf); proxy = new WebAppProxy(); addService(proxy); super.serviceInit(config); }
/** * Log in as the Kerberose principal designated for the proxy * @param conf the configuration holding this information in it. * @throws IOException on any error. */ protected void doSecureLogin(Configuration conf) throws IOException { InetSocketAddress socAddr = getBindAddress(conf); SecurityUtil.login(conf, YarnConfiguration.PROXY_KEYTAB, YarnConfiguration.PROXY_PRINCIPAL, socAddr.getHostName()); }
public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler()); StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG); try { YarnConfiguration configuration = new YarnConfiguration(); new GenericOptionsParser(configuration, args); WebAppProxyServer proxyServer = startServer(configuration); proxyServer.proxy.join(); } catch (Throwable t) { ExitUtil.terminate(-1, t); } }
/** * Start proxy server. * * @return proxy server instance. */ protected static WebAppProxyServer startServer(Configuration configuration) throws Exception { WebAppProxyServer proxy = new WebAppProxyServer(); ShutdownHookManager.get().addShutdownHook( new CompositeServiceShutdownHook(proxy), SHUTDOWN_HOOK_PRIORITY); proxy.init(configuration); proxy.start(); return proxy; }
@Override protected void serviceInit(Configuration conf) throws Exception { Configuration config = new YarnConfiguration(conf); doSecureLogin(conf); proxy = new WebAppProxy(); addService(proxy); DefaultMetricsSystem.initialize("WebAppProxyServer"); JvmMetrics jm = JvmMetrics.initSingleton("WebAppProxyServer", null); pauseMonitor = new JvmPauseMonitor(); addService(pauseMonitor); jm.setPauseMonitor(pauseMonitor); super.serviceInit(config); }
/** * Log in as the Kerberose principal designated for the proxy * @param conf the configuration holding this information in it. * @throws IOException on any error. */ protected void doSecureLogin(Configuration conf) throws IOException { InetSocketAddress socAddr = getBindAddress(conf); SecurityUtil.login(conf, YarnConfiguration.PROXY_KEYTAB, YarnConfiguration.PROXY_PRINCIPAL, socAddr.getHostName()); }
public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler()); StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG); try { YarnConfiguration configuration = new YarnConfiguration(); new GenericOptionsParser(configuration, args); WebAppProxyServer proxyServer = startServer(configuration); proxyServer.proxy.join(); } catch (Throwable t) { ExitUtil.terminate(-1, t); } }
/** * Start proxy server. * * @return proxy server instance. */ protected static WebAppProxyServer startServer(Configuration configuration) throws Exception { WebAppProxyServer proxy = new WebAppProxyServer(); ShutdownHookManager.get().addShutdownHook( new CompositeServiceShutdownHook(proxy), SHUTDOWN_HOOK_PRIORITY); proxy.init(configuration); proxy.start(); return proxy; }