1.3. Create Zookeeper cluster

  1. Download Zookeeper

  2. Extract file

  3. Put this file on at least 2 machines

  4. Open conf/zoo.cfg

  5. Select your data directory

    dataDir=/yourSelectedDirectory
  6. List the whole Zookeeper cluster with this scheme : server.numberOfServer=ip

    server.1=123.456.789.01:2888:5888
    server.2=456.789.123.02:2888:5888
    server.3=789.123.456.03:2888:5888
    [...]
  7. On each machine respect the same numberOfServer with the same ip.

  8. Start Zookeeper

    bin/zkServer.sh start
  9. Check if Zookeeper is runing

    bin/zkServer.sh status
  10. It is running if we can see

    JMX enabled by default
    Using config: ZOOKEEPER_HOME/bin/../conf/zoo.cfg
    Mode: follower

    Or

    JMX enabled by default
    Using config: ZOOKEEPER_HOME/bin/../conf/zoo.cfg
    Mode: leader
  11. Verify that numberOfServer matches the selected ip. Go to /yourSelectedDirectory and open myid on each machine.

    One the first machine (server.1=123.456.789.01:2888:5888 on the example), we have to see on myid : 1

    One the second machine (server.2=456.789.123.02:2888:5888 on the example), we have to see on myid : 2

    Etc.

  12. Leader and Followers

    On the Zookeeper cluster, we must have only one Leader and many Followers.