Skip to content
Browse files

Change Zookeeper path defaults

Currently the default leader path is "/leader" and the default election
path is "/election". These defaults make sense when Zookeeper is being
used for Alluxio only, but in real-world deployments, there will often
be multiple services making use of Zookeeper. Change the defaults to
something like "/alluxio/leader" and "/alluxio/election" so that there's
a better chance that users will not have to change them. It is
especially annoying to use non-default paths because clients need to be
configured with the leader path, and this configuration can't be
specified through a centralized cluster config, or by adding something
to the URI.

pr-link: #9103
change-id: cid-4720f78294dccc3d6f9a8431de47576ede394269
  • Loading branch information...
LuQQiu authored and alluxio-bot committed May 16, 2019
1 parent 7f6f3c5 commit 0ca68a3ab47a407f6338b84d9b43c9286d77ef78
@@ -93,7 +93,7 @@ public void zkFileSystemCacheTest() {
Map<String, String> sysProps = new HashMap<>();
sysProps.put(PropertyKey.ZOOKEEPER_ENABLED.getName(), Boolean.toString(true));
sysProps.put(PropertyKey.ZOOKEEPER_ADDRESS.getName(), "zk@");
sysProps.put(PropertyKey.ZOOKEEPER_ELECTION_PATH.getName(), "/leader");
sysProps.put(PropertyKey.ZOOKEEPER_ELECTION_PATH.getName(), "/alluxio/leader");

try (Closeable p = new SystemPropertyRule(sysProps).toResource()) {
@@ -467,7 +467,7 @@ public String toString() {
public static final PropertyKey ZOOKEEPER_ELECTION_PATH =
.setDescription("Election directory in ZooKeeper.")
@@ -485,7 +485,7 @@ public String toString() {
public static final PropertyKey ZOOKEEPER_LEADER_PATH =
.setDescription("Leader directory in ZooKeeper.")
@@ -235,8 +235,8 @@ public void restartZk() throws Exception {
protected void startMasters() throws IOException {
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ENABLED, "true");
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ADDRESS, mCuratorServer.getConnectString());
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ELECTION_PATH, "/election");
ServerConfiguration.set(PropertyKey.ZOOKEEPER_LEADER_PATH, "/leader");
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ELECTION_PATH, "/alluxio/election");
ServerConfiguration.set(PropertyKey.ZOOKEEPER_LEADER_PATH, "/alluxio/leader");

for (int k = 0; k < mNumOfMasters; k++) {

0 comments on commit 0ca68a3

Please sign in to comment.
You can’t perform that action at this time.