If you plan to use a multi-ZooKeeper cluster, you must configure each ZooKeeper with a unique number from the range 1, 2, 3 for a 3-ZooKeeper cluster or 1, 2, 3, 4, 5 for a 5-ZooKeeper cluster. You must include this number in the following file:
where < dataDir > is the path you set in your zoo.cfg file.
For example, you can run these commands:
sudo touch /var/lib/zookeeper/myid sudo -- sh -c 'echo <number> > /var/lib/zookeeper/myid'
where < number > is the appropriate number between 1 and 3, or 1 and 5.