Java Code Examples for org.apache.zookeeper.server.quorum.QuorumPeerMain#main()
The following examples show how to use
org.apache.zookeeper.server.quorum.QuorumPeerMain#main() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZooKeeperStarter.java From pulsar with Apache License 2.0 | 6 votes |
protected static void start(String[] args, String defaultStatsPort) throws Exception { // Register basic JVM metrics DefaultExports.initialize(); // Start Jetty to serve stats int port = Integer.parseInt(System.getProperties().getProperty("stats_server_port", defaultStatsPort)); log.info("Starting ZK stats HTTP server at port {}", port); InetSocketAddress httpEndpoint = InetSocketAddress.createUnresolved("0.0.0.0", port); Server server = new Server(httpEndpoint); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); server.setHandler(context); context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); try { server.start(); } catch (Exception e) { log.error("Failed to start HTTP server at port {}. Use \"-Dstats_server_port=1234\" to change port number", port, e); throw e; } // Start the regular ZooKeeper server QuorumPeerMain.main(args); }
Example 2
Source File: ZooKeeperClientTest.java From Mario with Apache License 2.0 | 5 votes |
@Override public void run() { String[] args = new String[2]; args[0] = port; args[1] = "./zk_test_data/zkdata" + this.getId(); QuorumPeerMain.main(args); }
Example 3
Source File: ZooKeeperClusterTest.java From Mario with Apache License 2.0 | 5 votes |
@Override public void run() { String[] args = new String[2]; args[0] = port; args[1] = "./zk_test_data/zkdata" + this.getId(); QuorumPeerMain.main(args); }
Example 4
Source File: ZooKeeperStateTest.java From Mario with Apache License 2.0 | 5 votes |
@Override public void run() { String[] args = new String[2]; args[0] = port; args[1] = "./zk_test_data/zkdata" + this.getId(); QuorumPeerMain.main(args); }