Examples of QuorumPeerConfig


Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

  public static void main(String[] args) {
    HBaseConfiguration conf = new HBaseConfiguration();
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

            zkProperties.setProperty("maxSessionTimeout", "100000");
            zkProperties.setProperty("initLimit", "10");
            zkProperties.setProperty("syncLimit", "5");
            zkProperties.setProperty("snapCount", "50000");

            QuorumPeerConfig qpConfig = new QuorumPeerConfig();
            qpConfig.parseProperties(zkProperties);

            // create and run the zookeeper instance
            final InternalZooKeeper zookeeper = new InternalZooKeeper();
            final ServerConfig zkConfig = new ServerConfig();
            zkConfig.readFrom(qpConfig);
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

  public static void run(Configuration baseConf) {
    Configuration conf = new HamaConfiguration(baseConf);
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

  public static void main(String[] args) {
    Configuration conf = HBaseConfiguration.create();
    try {
      Properties zkProperties = ZKConfig.makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

  public void startZooKeeper(final Properties properties, boolean format, String path, final boolean randomPort) {
    String realPath = path + "/zk_test";
    properties.setProperty("dataDir", realPath);
    final ServerConfig serverConfig = new ServerConfig();
    QuorumPeerConfig config = new QuorumPeerConfig() {
      @Override
      public InetSocketAddress getClientPortAddress() {
        InetSocketAddress clientPortAddress = super.getClientPortAddress();
        if (randomPort) {
          return randomPort(clientPortAddress);
        }
        return clientPortAddress;
      }

      private InetSocketAddress randomPort(InetSocketAddress clientPortAddress) {
        return new InetSocketAddress(clientPortAddress.getAddress(), 0);
      }
    };
    try {
      config.parseProperties(properties);
    } catch (IOException e) {
      LOG.error(e);
      throw new RuntimeException(e);
    } catch (ConfigException e) {
      LOG.error(e);
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

   * @param conf Hadoop Configuration.
   */
  public static void runZooKeeper(Configuration conf) throws Exception {
    Properties zkProperties = makeZKProps(conf);
    writeMyID(zkProperties);
    QuorumPeerConfig zkConfig = new QuorumPeerConfig();
    zkConfig.parseProperties(zkProperties);
    runZKServer(zkConfig);
  }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

   */
  public static ZookeeperTuple runShutdownableZooKeeper(Configuration conf)
      throws Exception {
    Properties zkProperties = makeZKProps(conf);
    writeMyID(zkProperties);
    QuorumPeerConfig zkConfig = new QuorumPeerConfig();
    zkConfig.parseProperties(zkProperties);
    ShutdownableZooKeeperServerMain zk = new ShutdownableZooKeeperServerMain();
    ServerConfig serverConfig = new ServerConfig();
    serverConfig.readFrom(zkConfig);
    return new ZookeeperTuple(zk, serverConfig);
  }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

                                     new Path(outputDir.toString()));

      // Configure a local zookeeper instance
      Properties zkProperties = configLocalZooKeeper(zkDir);

      QuorumPeerConfig qpConfig = new QuorumPeerConfig();
      qpConfig.parseProperties(zkProperties);

      // Create and run the zookeeper instance
      final InternalZooKeeper zookeeper = new InternalZooKeeper();
      final ServerConfig zkConfig = new ServerConfig();
      zkConfig.readFrom(qpConfig);
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

      GiraphConstants.CHECKPOINT_DIRECTORY.set(conf, checkpointsDir.toString());

      // Configure a local zookeeper instance
      Properties zkProperties = configLocalZooKeeper(zkDir);

      QuorumPeerConfig qpConfig = new QuorumPeerConfig();
      qpConfig.parseProperties(zkProperties);

      // Create and run the zookeeper instance
      final InternalZooKeeper zookeeper = new InternalZooKeeper();
      final ServerConfig zkConfig = new ServerConfig();
      zkConfig.readFrom(qpConfig);
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig

      @Override
      public void run() {
        try {
          // Configure a local zookeeper instance
          Properties zkProperties = generateLocalZkProperties();
          QuorumPeerConfig qpConfig = new QuorumPeerConfig();
          qpConfig.parseProperties(zkProperties);
          // run the zookeeper instance
          final ServerConfig zkConfig = new ServerConfig();
          zkConfig.readFrom(qpConfig);
          zookeeper.runFromConfig(zkConfig);
        } catch (QuorumPeerConfig.ConfigException qpcce) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.