0

I am running 2 dedicated servers on which I plan to install Solrcloud. I have installed ZooKeeper using apt-get install zookeeperd and ZooKeeper is running on both systems.

From solr docs I learned that 3 zookeepers are recommended for production.

How could I add a second zookeeper to one machine? The config only allows one.

030
  • 5,731
  • 12
  • 61
  • 107
merlin
  • 2,033
  • 11
  • 37
  • 72
  • use docker! or another system of containers(lxd for example) – Navern Aug 20 '15 at 09:23
  • @Utrecht, initial question was how to add second zookeeper to same machine:) Docker is answer for this question. You can use apt-get install and have two zookeepers. – Navern Aug 20 '15 at 09:32
  • @Utrecht, you are right:) this should be also mentioned in answer. – Navern Aug 20 '15 at 09:43

2 Answers2

0

You could download two tar.gz zookeeper packages, extract them to a directory /path/to/zookeepers as zookeeper_one and zookeeper_two. Subsequently you could copy the zookeeper service script that resides in the apt-get package, modify the path and port and start two zookeepers. Note that it is strongly recommended to use one zookeeper per node as if multiple zookeepers are running on the same node and the node goes down the whole quorum goes down.

Technically I agree with @Navern to use containers as this is an option to run multiple zookeepers on the same machine. However, from a Zookeeper quorum perspective maximum one zookeeper server should be installed on one node. E.g., using 5 zookeepers means that 2 nodes can go down without any problem. 5 zookeepers on two nodes means that if the node goes down that contains 3 zookeepers that the quorum goes down, i.e. SPOF

030
  • 5,731
  • 12
  • 61
  • 107
  • So a setup of 2 dedicated servers would not be sufficient to avoid a SPOF? – merlin Aug 20 '15 at 09:27
  • Would I still be able to serve read requests with one zk alive? – merlin Aug 20 '15 at 09:30
  • I just tried the setup I have with 2 machines and 2 ZK. I can definatelly take one machine down and the site is still available with solr serving requests. However the admin interface of solr keeps loading the cloud tab and I can not see the nodes. Would 1 ZK mean, that I am able to serve read requests stable? That would be sufficient. – merlin Aug 20 '15 at 12:50
  • To avoid the problem of not to be able to write to solr once the machine with 2 ZK goes entirely down, it would theoretically be possible to run 2 ZK on each machine - thus 4 ZK or even 5. So I still don't see the point of adding a third machine to the setup. – merlin Aug 20 '15 at 21:00
  • I understand now. You would need a majority of the ensemble to stay live in order to have full service. ... OK. sounds like there is no choice then renting and operating 3 seperate machines.Thank you for your help. – merlin Aug 21 '15 at 11:19
0

I suggest to use docker for this task.

You create one image with Dockerfile, then run two containers with different ports published. In your Dockerfile you can use apt-get install zookeeperd.

Docker will help with creating isolated environment.

Navern
  • 1,569
  • 1
  • 9
  • 14