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

Small fix in zkServer.sh to support new configuration format

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.0
    • Component/s: scripts
    • Labels:
      None

      Description

      The problem can be reproduced by running a server with the following type of config file:

      dataDir=/Users/shralex/zookeeper-test/zookeeper1
      syncLimit=2
      initLimit=5
      tickTime=2000
      server.1=localhost:2721:2731:participant;2791
      server.2=localhost:2722:2732:participant;2792

      and then trying to do "zkServer.sh status"

      Here I specified the servers using the new config format but still used the static config file and didn't include the "clientPort" key.

      zkServer.sh already supports the new configuration format, but expects server spec to appear in the dynamic config file if it uses the new format.
      So in the example above it will not find the client port.

      The current logic for executing something like 'zkServer.sh status' is:

      1. Look for clientPort keyword in the static config file
      2. Look for the client port in the server spec in the dynamic config file

      The attached patch adds an intermediate step:
      1'. Look for the client port in the server spec in the static config file

        Attachments

        1. zkServersh.patch
          1 kB
          Alexander Shraer

          Issue Links

            Activity

              People

              • Assignee:
                shralex Alexander Shraer
                Reporter:
                shralex Alexander Shraer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: