Search in sources :

Example 11 with ZooKeeperServerMain

use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.server.ZooKeeperServerMain in project hbase by apache.

the class HQuorumPeer method runZKServer.

private static void runZKServer(QuorumPeerConfig zkConfig) throws IOException, AdminServer.AdminServerException {
    /**
     *  Start and schedule the purge task
     *  autopurge.purgeInterval is 0 by default,so in fact the DatadirCleanupManager task will not
     *  be started to clean the logs by default. Config is recommended only for standalone server.
     */
    DatadirCleanupManager purgeMgr = new DatadirCleanupManager(zkConfig.getDataDir(), zkConfig.getDataLogDir(), zkConfig.getSnapRetainCount(), zkConfig.getPurgeInterval());
    purgeMgr.start();
    if (zkConfig.isDistributed()) {
        QuorumPeerMain qp = new QuorumPeerMain();
        qp.runFromConfig(zkConfig);
    } else {
        ZooKeeperServerMain zk = new ZooKeeperServerMain();
        ServerConfig serverConfig = new ServerConfig();
        serverConfig.readFrom(zkConfig);
        zk.runFromConfig(serverConfig);
    }
}
Also used : DatadirCleanupManager(org.apache.zookeeper.server.DatadirCleanupManager) ServerConfig(org.apache.zookeeper.server.ServerConfig) QuorumPeerMain(org.apache.zookeeper.server.quorum.QuorumPeerMain) ZooKeeperServerMain(org.apache.zookeeper.server.ZooKeeperServerMain)

Aggregations

ServerConfig (org.apache.zookeeper.server.ServerConfig)10 ZooKeeperServerMain (org.apache.zookeeper.server.ZooKeeperServerMain)10 IOException (java.io.IOException)6 Properties (java.util.Properties)5 QuorumPeerConfig (org.apache.zookeeper.server.quorum.QuorumPeerConfig)5 File (java.io.File)4 InputStream (java.io.InputStream)3 QuorumPeerMain (org.apache.zookeeper.server.quorum.QuorumPeerMain)3 DatadirCleanupManager (org.apache.zookeeper.server.DatadirCleanupManager)2 FileInputStream (java.io.FileInputStream)1 UnknownHostException (java.net.UnknownHostException)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 TimeoutException (java.util.concurrent.TimeoutException)1 SaslException (javax.security.sasl.SaslException)1 CarbonProperties (org.apache.carbondata.core.util.CarbonProperties)1 ServerConfig (org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.server.ServerConfig)1 ZooKeeperServerMain (org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.server.ZooKeeperServerMain)1 QuorumPeerConfig (org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.server.quorum.QuorumPeerConfig)1 QuorumPeerMain (org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.server.quorum.QuorumPeerMain)1 SolrException (org.apache.solr.common.SolrException)1