Package org.apache.zookeeper.server.quorum

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()


    System.setProperty("hbase.master.hostname", "foo.bar");
    is = new ByteArrayInputStream(s.getBytes());
    properties = ZKConfig.parseZooCfg(conf, is);
    assertEquals("foo.bar:2888:3888", properties.get("server.0"));

    config.parseProperties(properties);

    servers = config.getServers();
    server = servers.get(Long.valueOf(0));
    assertEquals("foo.bar", server.addr.getHostName());
  }
View Full Code Here


    Configuration conf = HBaseConfiguration.create();
    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

    assertEquals(dataDir.toString(), properties.get("dataDir"));
    assertEquals(Integer.valueOf(2181), Integer.valueOf(properties.getProperty("clientPort")));
    assertEquals("localhost:2888:3888", properties.get("server.0"));

    QuorumPeerConfig config = new QuorumPeerConfig();
    config.parseProperties(properties);

    assertEquals(dataDir.toString(), config.getDataDir());
    assertEquals(2181, config.getClientPortAddress().getPort());
    Map<Long,QuorumServer> servers = config.getServers();
    assertEquals(1, servers.size());
View Full Code Here

    System.setProperty("hbase.master.hostname", "foo.bar");
    is = new ByteArrayInputStream(s.getBytes());
    properties = HQuorumPeer.parseZooCfg(conf, is);
    assertEquals("foo.bar:2888:3888", properties.get("server.0"));

    config.parseProperties(properties);

    servers = config.getServers();
    server = servers.get(Long.valueOf(0));
    assertEquals("foo.bar", server.addr.getHostName());
  }
View Full Code Here

                properties.setProperty("server." + thisSpec.getServerId(), String.format("localhost:%d:%d", thisSpec.getQuorumPort(), thisSpec.getElectionPort()));
            }
        }

        QuorumPeerConfig config = new QuorumPeerConfig();
        config.parseProperties(properties);
        return config;
    }
}
View Full Code Here

    Configuration conf = new HamaConfiguration(baseConf);
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      LOG.error("Exception during ZooKeeper startup - exiting...",e);
      System.exit(-1);
    }
View Full Code Here

    assertEquals(dataDir.toString(), properties.get("dataDir"));
    assertEquals(Integer.valueOf(2181), Integer.valueOf(properties.getProperty("clientPort")));
    assertEquals("localhost:2888:3888", properties.get("server.0"));

    QuorumPeerConfig config = new QuorumPeerConfig();
    config.parseProperties(properties);

    int tickTime = config.getTickTime();
    assertEquals(2000, tickTime);
    int initLimit = config.getInitLimit();
    assertEquals(10, initLimit);
View Full Code Here

    System.setProperty("hbase.master.hostname", "foo.bar");
    is = new ByteArrayInputStream(s.getBytes());
    properties = HQuorumPeer.parseZooCfg(conf, is);
    assertEquals("foo.bar:2888:3888", properties.get("server.0"));

    config.parseProperties(properties);

    servers = config.getServers();
    server = servers.get(Long.valueOf(0));
    assertEquals("foo.bar", server.addr.getHostName());
  }
View Full Code Here

    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

    Configuration conf = HBaseConfiguration.create();
    try {
      Properties zkProperties = ZKConfig.makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);

      // login the zookeeper server principal (if using security)
      ZKUtil.loginServer(conf, "hbase.zookeeper.server.keytab.file",
        "hbase.zookeeper.server.kerberos.principal",
        zkConfig.getClientPortAddress().getHostName());
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.