I am able to run single zookeeper instance on my windows machine. but getting success to setup multiple zookeeper instances on single windows machine.
As per guideline I did following steps:
Creating multiple zoo.conf file into conf folder. Structure as below
zookeeper_home---| conf--| zoo.cfg zoo_2.cfg zoo_3.cfg
zoo.cfg
tickTime=2000 initLimit=10 syncLimit=5 dataDir=c:/opt/zookeeper/data clientPort=2181 server.1=localhost:2888:3888 server.2=localhost:2889:3889 server.3=localhost:2890:3890
- zoo_2.cfg
tickTime=2000 initLimit=10 syncLimit=5 dataDir=c:/opt/zookeeper/data2 clientPort=2182 server.1=localhost:2888:3888 server.2=localhost:2889:3889 server.3=localhost:2890:3890
- zoo_3.cfg
tickTime=2000 initLimit=10 syncLimit=5 dataDir=c:/opt/zookeeper/data3 clientPort=2183 server.1=localhost:2888:3888 server.2=localhost:2889:3889 server.3=localhost:2890:3890
- As each file has dataDir, I have created folder as
c:/opt/zookeeper/data
c:/opt/zookeeper/data2
c:/opt/zookeeper/data3
Also created myid file in each of above folder with number 1,2,3 respectively.
now whenever I am trying to start server as c:\opt\zookeeper\bin>zkServer.cmd
it is throwing an error as
Cannot open channel to 2 at election address localhost/127.0.0.1:3889
Cannot open channel to 3 at election address localhost/127.0.0.1:3890
java.net.ConnectException: Connection refused: connect
looks like server not started, but how I can start these server parallely? or is I have to user any other approach.