/** * @return the actual JournalNode HTTP/HTTPS address. */ public InetSocketAddress getBoundHttpAddress() { return httpServer.getAddress(); }
/** * @return JournalNode HTTP address */ public InetSocketAddress getHttpAddress() { return httpServer.getHttpAddress(); }
/** * @return JournalNode HTTPS address */ public InetSocketAddress getHttpsAddress() { return httpServer.getHttpsAddress(); } }
httpServer = new JournalNodeHttpServer(conf, this, getHttpServerBindAddress(conf)); httpServer.start(); httpServerURI = httpServer.getServerURI().toString();
httpServer.stop(); } catch (IOException ioe) { LOG.warn("Unable to stop HTTP server for " + this, ioe);
.getJournalFromContext(context, journalId).getStorage();
/** * Start listening for edits via RPC. */ public void start() throws IOException { Preconditions.checkState(!isStarted(), "JN already running"); validateAndCreateJournalDir(localDir); DefaultMetricsSystem.initialize("JournalNode"); JvmMetrics.create("JournalNode", conf.get(DFSConfigKeys.DFS_METRICS_SESSION_ID_KEY), DefaultMetricsSystem.instance()); InetSocketAddress socAddr = JournalNodeRpcServer.getAddress(conf); SecurityUtil.login(conf, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY, DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_PRINCIPAL_KEY, socAddr.getHostName()); registerJNMXBean(); httpServer = new JournalNodeHttpServer(conf, this); httpServer.start(); httpServerURI = httpServer.getServerURI().toString(); rpcServer = new JournalNodeRpcServer(conf, this); rpcServer.start(); }
/** * Stop the daemon with the given status code * @param rc the status code with which to exit (non-zero * should indicate an error) */ public void stop(int rc) { this.resultCode = rc; if (rpcServer != null) { rpcServer.stop(); } if (httpServer != null) { try { httpServer.stop(); } catch (IOException ioe) { LOG.warn("Unable to stop HTTP server for " + this, ioe); } } for (Journal j : journalsById.values()) { IOUtils.cleanup(LOG, j); } if (journalNodeInfoBeanName != null) { MBeans.unregister(journalNodeInfoBeanName); journalNodeInfoBeanName = null; } }
QuorumJournalManager.checkJournalId(journalId); final JNStorage storage = JournalNodeHttpServer .getJournalFromContext(context, journalId).getStorage();
/** * Start listening for edits via RPC. */ public void start() throws IOException { Preconditions.checkState(!isStarted(), "JN already running"); validateAndCreateJournalDir(localDir); DefaultMetricsSystem.initialize("JournalNode"); JvmMetrics.create("JournalNode", conf.get(DFSConfigKeys.DFS_METRICS_SESSION_ID_KEY), DefaultMetricsSystem.instance()); InetSocketAddress socAddr = JournalNodeRpcServer.getAddress(conf); SecurityUtil.login(conf, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY, DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_PRINCIPAL_KEY, socAddr.getHostName()); registerJNMXBean(); httpServer = new JournalNodeHttpServer(conf, this); httpServer.start(); httpServerURI = httpServer.getServerURI().toString(); rpcServer = new JournalNodeRpcServer(conf, this); rpcServer.start(); }
@Deprecated public InetSocketAddress getBoundHttpAddress() { return httpServer.getAddress(); }
/** * Stop the daemon with the given status code * @param rc the status code with which to exit (non-zero * should indicate an error) */ public void stop(int rc) { this.resultCode = rc; if (rpcServer != null) { rpcServer.stop(); } if (httpServer != null) { try { httpServer.stop(); } catch (IOException ioe) { LOG.warn("Unable to stop HTTP server for " + this, ioe); } } for (Journal j : journalsById.values()) { IOUtils.cleanup(LOG, j); } if (journalNodeInfoBeanName != null) { MBeans.unregister(journalNodeInfoBeanName); journalNodeInfoBeanName = null; } }
QuorumJournalManager.checkJournalId(journalId); final JNStorage storage = JournalNodeHttpServer .getJournalFromContext(context, journalId).getStorage();
@Deprecated public InetSocketAddress getBoundHttpAddress() { return httpServer.getAddress(); }
void start() throws IOException { final InetSocketAddress httpAddr = getAddress(conf); final String httpsAddrString = conf.get( DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_KEY, DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_DEFAULT); InetSocketAddress httpsAddr = NetUtils.createSocketAddr(httpsAddrString); HttpServer2.Builder builder = DFSUtil.httpServerTemplateForNNAndJN(conf, httpAddr, httpsAddr, "journal", DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_INTERNAL_SPNEGO_PRINCIPAL_KEY, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY); httpServer = builder.build(); httpServer.setAttribute(JN_ATTRIBUTE_KEY, localJournalNode); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true); httpServer.start(); }
void start() throws IOException { final InetSocketAddress httpAddr = getAddress(conf); final String httpsAddrString = conf.get( DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_KEY, DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_DEFAULT); InetSocketAddress httpsAddr = NetUtils.createSocketAddr(httpsAddrString); HttpServer2.Builder builder = DFSUtil.httpServerTemplateForNNAndJN(conf, httpAddr, httpsAddr, "journal", DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_INTERNAL_SPNEGO_PRINCIPAL_KEY, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY); httpServer = builder.build(); httpServer.setAttribute(JN_ATTRIBUTE_KEY, localJournalNode); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true); httpServer.start(); }