diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 686ff15dc80..4429d8148c9 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -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; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java index 2a3ef089862..6ac681e257d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java @@ -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",