0

I am currently working with replicated servers in the same machine..for instance I am now working with 3 servers ...Now I want to add 2 more server ...How to add it dynamically this is my zoo.cfg file

tickTime=2000
dataDir=F:\zookeeper
clientPort=2182
initLimit=5
syncLimit=2
server.1=localhost:2888:3888
server.2=localhost:2889:3889
server.3=localhost:2890:3890

Now I want to add two more servers dynamically

user3797438
  • 405
  • 3
  • 6
  • 24

2 Answers2

1

Since version 3.5.0, Zookeeper has a Dynamic Reconfiguration feature which allows servers to be added or removed and the entire process is orchestrated via Zookeeper itself. See https://zookeeper.apache.org/doc/r3.5.3-beta/zookeeperReconfig.html. From my experience, reconfiguring an ensemble on version 3.4.6 can get very strange.

The_Coder
  • 321
  • 5
  • 18
toppur
  • 1,606
  • 13
  • 12
0

server.4=localhost:2891:3891

server.5=localhost:2892:3892

Add above lines to your cfg file .

For details check : ..what is zookeeper port and its usage?

Community
  • 1
  • 1
Sandeep Das
  • 1,010
  • 9
  • 22
  • 1
    ...I want to add it dynamically..not editing the zoo.cfg file..Is there any way?@Sandeep Das – user3797438 Aug 14 '14 at 07:02
  • With version 3.5.0 and up, you can add it dynamically. [See the docs](https://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html) `reconfig -add server.5=125.23.63.23:1234:1235;1236` – toppur May 17 '17 at 22:43