Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2257

Make zookeeper server principal configurable at zookeeper client side

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently Zookeeper client expects zookeeper server's principal to be in the form of zookeeper.sasl.client.username/server-ip for example zookeeper/192.162.1.100.
      But this may not always be the case server principal can be some thing like zookeeper/hadoop.foo.com
      It would be better if we can make server principal configurable.

      Current Code:

      String principalUserName = System.getProperty(ZK_SASL_CLIENT_USERNAME, "zookeeper");
      zooKeeperSaslClient = new ZooKeeperSaslClient(principalUserName + "/" + addr.getHostString());
      

      Proposed Code:

      String serverPrincipal = System.getProperty("zookeeper.server.principal");
      if (null != serverPrincipal) {
          zooKeeperSaslClient = new ZooKeeperSaslClient(serverPrincipal);
      } else {
          String principalUserName = System.getProperty(ZK_SASL_CLIENT_USERNAME, "zookeeper");
          zooKeeperSaslClient = new ZooKeeperSaslClient(principalUserName + "/" + addr.getHostString());
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arshad.mohammad Mohammad Arshad
                Reporter:
                arshad.mohammad Mohammad Arshad
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: