protected void startInfoServer() throws IOException { // Put up info server. int port = conf.getInt(THRIFT_INFO_SERVER_PORT , THRIFT_INFO_SERVER_PORT_DEFAULT); if (port >= 0) { conf.setLong("startcode", System.currentTimeMillis()); String a = conf .get(THRIFT_INFO_SERVER_BINDING_ADDRESS, THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT); infoServer = new InfoServer("thrift", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); infoServer.start(); } }
public void stop() { if (this.infoServer != null) { LOG.info("Stopping infoServer"); try { this.infoServer.stop(); } catch (Exception ex) { LOG.error("Failed to stop infoServer", ex); } } if (pauseMonitor != null) { pauseMonitor.stop(); } if (tserver != null) { tserver.stop(); tserver = null; } if (httpServer != null) { try { httpServer.stop(); httpServer = null; } catch (Exception e) { LOG.error("Problem encountered in shutting down HTTP server", e); } httpServer = null; } }
while (true) { try { this.infoServer = new InfoServer(getProcessName(), addr, port, false, this.conf); infoServer.addServlet("dump", "/dump", getDumpServlet()); configureInfoServer(); this.infoServer.start(); break; } catch (BindException e) { port = this.infoServer.getPort(); conf.setInt(HConstants.REGIONSERVER_INFO_PORT, port); int masterInfoPort = conf.getInt(HConstants.MASTER_INFO_PORT,
protected void configureInfoServer() { infoServer.addServlet("rs-status", "/rs-status", RSStatusServlet.class); infoServer.setAttribute(REGIONSERVER, this); }
/** * @param infoServer that we're trying to send all requests to * @param hostname may be null. if given, will be used for redirects instead of host from client. */ public RedirectServlet(InfoServer infoServer, String hostname) { regionServerInfoPort = infoServer.getPort(); regionServerHostname = hostname; }
@Override protected void configureInfoServer() { infoServer.addServlet("master-status", "/master-status", MasterStatusServlet.class); infoServer.setAttribute(MASTER, this); if (LoadBalancer.isTablesOnMaster(conf)) { super.configureInfoServer(); } }
return -1; if(infoPort == infoServer.getPort()) { return infoPort;
conf.setLong("startcode", System.currentTimeMillis()); String a = conf.get("hbase.rest.info.bindAddress", "0.0.0.0"); InfoServer infoServer = new InfoServer("rest", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); infoServer.start();
while (true) { try { this.infoServer = new InfoServer(getProcessName(), addr, port, false, this.conf); infoServer.addServlet("dump", "/dump", getDumpServlet()); configureInfoServer(); this.infoServer.start(); break; } catch (BindException e) { port = this.infoServer.getPort(); conf.setInt(HConstants.REGIONSERVER_INFO_PORT, port); int masterInfoPort = conf.getInt(HConstants.MASTER_INFO_PORT,
protected void configureInfoServer() { infoServer.addServlet("rs-status", "/rs-status", RSStatusServlet.class); infoServer.setAttribute(REGIONSERVER, this); }
/** * Get some information of the region server. * * @param controller the RPC controller * @param request the request * @throws ServiceException */ @Override @QosPriority(priority=HConstants.ADMIN_QOS) public GetServerInfoResponse getServerInfo(final RpcController controller, final GetServerInfoRequest request) throws ServiceException { try { checkOpen(); } catch (IOException ie) { throw new ServiceException(ie); } requestCount.increment(); int infoPort = regionServer.infoServer != null ? regionServer.infoServer.getPort() : -1; return ResponseConverter.buildGetServerInfoResponse(regionServer.serverName, infoPort); }
LOG.info("Stopping infoServer"); try { this.infoServer.stop(); } catch (Exception e) { LOG.error("Failed to stop infoServer", e);
/** * Start up or shuts down the Thrift server, depending on the arguments. * @param args */ void doMain(final String[] args) throws Exception { processOptions(args); serverRunner = new ThriftServerRunner(conf); // Put up info server. int port = conf.getInt("hbase.thrift.info.port", 9095); if (port >= 0) { conf.setLong("startcode", System.currentTimeMillis()); String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); infoServer = new InfoServer("thrift", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); infoServer.start(); } serverRunner.run(); }
@Override protected void configureInfoServer() { infoServer.addServlet("master-status", "/master-status", MasterStatusServlet.class); infoServer.setAttribute(MASTER, this); if (BaseLoadBalancer.tablesOnMaster(conf)) { super.configureInfoServer(); } }
/** * Test that the status pages in the minicluster load properly. * * This is somewhat a duplicate of TestRSStatusServlet and * TestMasterStatusServlet, but those are true unit tests * whereas this uses a cluster. */ @Test public void testInfoServersStatusPages() throws Exception { int port = UTIL.getHBaseCluster().getMaster().getInfoServer().getPort(); assertContainsContent(new URL("http://localhost:" + port + "/master-status"), "meta"); port = UTIL.getHBaseCluster().getRegionServerThreads().get(0).getRegionServer() .getInfoServer().getPort(); assertContainsContent(new URL("http://localhost:" + port + "/rs-status"), "meta"); }
@Override public void stop() throws Exception { if (infoServer != null) { infoServer.stop(); } server.stop(); }
/** * Start up or shuts down the Thrift server, depending on the arguments. * @param args */ void doMain(final String[] args) throws Exception { processOptions(args); serverRunner = new ThriftServerRunner(conf); // Put up info server. int port = conf.getInt("hbase.thrift.info.port", 9095); if (port >= 0) { conf.setLong("startcode", System.currentTimeMillis()); String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); infoServer = new InfoServer("thrift", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); infoServer.start(); } serverRunner.run(); }
@Test public void testMasterServerReadOnly() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); byte[] cf = Bytes.toBytes("d"); UTIL.createTable(tableName, cf); UTIL.waitTableAvailable(tableName); int port = UTIL.getHBaseCluster().getMaster().getInfoServer().getPort(); assertDoesNotContainContent(new URL("http://localhost:" + port + "/table.jsp?name=" + tableName + "&action=split&key="), "Table action request accepted"); assertDoesNotContainContent( new URL("http://localhost:" + port + "/table.jsp?name=" + tableName), "Actions:"); }
public void stop() { if (this.infoServer != null) { LOG.info("Stopping infoServer"); try { this.infoServer.stop(); } catch (Exception ex) { ex.printStackTrace(); } } serverRunner.shutdown(); }
conf.setLong("startcode", System.currentTimeMillis()); String a = conf.get("hbase.rest.info.bindAddress", "0.0.0.0"); InfoServer infoServer = new InfoServer("rest", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); infoServer.start();