HBASE-13183 Make ZK tickTime configurable in standalone HBase (Alex Araujo)

This commit is contained in:
Andrew Purtell 2015-03-09 18:34:48 -07:00
parent 280120ee15
commit 4afae59cfa
2 changed files with 9 additions and 0 deletions

View File

@ -202,6 +202,10 @@ public final class HConstants {
public static final String ZOOKEEPER_DATA_DIR =
ZK_CFG_PROPERTY_PREFIX + "dataDir";
/** Parameter name for the ZK tick time */
public static final String ZOOKEEPER_TICK_TIME =
ZK_CFG_PROPERTY_PREFIX + "tickTime";
/** Default limit on concurrent client-side zookeeper connections */
public static final int DEFAULT_ZOOKEPER_MAX_CLIENT_CNXNS = 300;

View File

@ -191,6 +191,11 @@ public class HMasterCommandLine extends ServerCommandLine {
}
}
zooKeeperCluster.setDefaultClientPort(zkClientPort);
// set the ZK tick time if specified
int zkTickTime = conf.getInt(HConstants.ZOOKEEPER_TICK_TIME, 0);
if (zkTickTime > 0) {
zooKeeperCluster.setTickTime(zkTickTime);
}
// login the zookeeper server principal (if using security)
ZKUtil.loginServer(conf, "hbase.zookeeper.server.keytab.file",