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

Script that provide a way to build the ensemble with ease.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.5.0
    • None
    • scripts
    • None

    Description

      Starting with 3.5.0, ZooKeeper has already supported a very convenient dynamic reconfiguration. However, the procedure is slightly complicated. So I propose adding a script to build ensemble with ease.

      Usage:

      $ ./bin/zkEnsemble.sh help
      usage: ./bin/zkEnsemble.sh {start|stop|status} <parameters>
        Commadns:
          start                   Start a node of ensemble.
            Parameters:
              --seed              Specify the IP address and port of an existing ensemble node that required for 2nd and subsequent nodes.
                                  This is not required for the 1st node. (Example: 127.0.0.1:2181)
              --ip                Normally, you do not need to specify because it is automatically detected.
                                  If it seems the wrong IP address is found automatically, you can over ride the IP address with this option.
              --clientport        The port is used to client connections (2181 by default).
              --peerport          The port is used to talk to each other (2888 by default).
                                  If omitted, it will use the minimum port number that is available between 2888 to 3142.
              --electionport      The port is used to leader election (3888 by default).
                                  If omitted, it will use the minimum port number that is available between 3888 to 4142.
              --role              The role of node, it can be participant or observer (participant by default).
              --clientip          The IP address for client connections (0.0.0.0 by default).
                                  If omitted, it will use the minimum port number that is available between 2181 to 2435.
              --confdir           Specify a base conf directory (/Users/mosuka/git/zookeeper/conf by default).
              --datadir           Specify a base data directory (/tmp/zookeeper by default).
              --foreground        Start node in foreground.
      
          stop                    Stop a node of ensemble.
            Parameters:
              --ip                Normally, you do not need to specify because it is automatically detected.
                                  If it seems the wrong IP address is found automatically, you can over ride the IP address with this option.
              --clientport        The port is used to client connections (2181 by default).
      
          status                  Show ensemble nodes.
            Parameters:
              --seed              Specify the IP address and port of a existing ensemble node (Example: 127.0.0.1:2181).
      
          help                    Display this message.
      

      Example:
      1. Start a 1st node of ensemble on host1(192.168.33.11)

      $ ./bin/zkEnsemble.sh start
      ZooKeeper JMX enabled by default
      Using config: /Users/minoru/zookeeper/zookeeper-3.5.0/conf/server.1.cfg
      Starting zookeeper ... STARTED
      

      2. Start a 2nd node of ensemble on host2(192.168.33.12).

      $ ./bin/zkEnsemble.sh start --seed=192.168.33.11:2181
      ZooKeeper JMX enabled by default
      Using config: /Users/minoru/zookeeper/zookeeper-3.5.0/conf/server.2.cfg
      Starting zookeeper ... STARTED
      

      3. Start a 3rd node of ensemble on host3(192.168.33.13).

      $ ./bin/zkEnsemble.sh start --seed=192.168.33.11:2181
      ZooKeeper JMX enabled by default
      Using config: /Users/minoru/zookeeper/zookeeper-3.5.0/conf/server.3.cfg
      Starting zookeeper ... STARTED
      

      4. Show ensemble nodes on host1(192.168.33.11).

      $ ./bin/zkEnsemble.sh status --seed=192.168.33.11:2181
      server.1=192.168.33.11:2888:3888:participant;0.0.0.0:2181
      server.2=192.168.33.12:2888:3888:participant;0.0.0.0:2181
      server.3=192.168.33.13:2888:3888:participant;0.0.0.0:2181
      

      5. Stop a 2nd node of ensemble on host2(192.168.33.12).

      $ ./bin/zkEnsemble.sh stop
      Using config: /Users/minoru/zookeeper/zookeeper-3.5.0/conf/server.2.cfg
      Stopping zookeeper ... STOPPED
      

      6. Show ensemble nodes on host1(192.168.33.11).

      $ ./bin/zkEnsemble.sh status --seed=192.168.33.11:2181
      server.1=192.168.33.11:2888:3888:participant;0.0.0.0:2181
      server.3=192.168.33.13:2888:3888:participant;0.0.0.0:2181
      

      7. Start a 2nd node of ensemble on host2(192.168.33.12).

      $ ./bin/zkEnsemble.sh start --seed=192.168.33.11:2181
      ZooKeeper JMX enabled by default
      Using config: /Users/minoru/zookeeper/zookeeper-3.5.0/conf/server.2.cfg
      Starting zookeeper ... STARTED
      

      8. Show ensemble nodes on host1(192.168.33.11).

      $ ./bin/zkEnsemble.sh status --seed=192.168.33.11:2181
      server.1=192.168.33.11:2888:3888:participant;0.0.0.0:2181
      server.2=192.168.33.12:2888:3888:participant;0.0.0.0:2181
      server.3=192.168.33.13:2888:3888:participant;0.0.0.0:2181
      

      Attachments

        1. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        2. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        3. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        4. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        5. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        6. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        7. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka
        8. ZOOKEEPER-2350.patch
          17 kB
          Minoru Osuka

        Activity

          People

            Unassigned Unassigned
            minoru Minoru Osuka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: