[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587078#comment-14587078
 ] 

Vincenzo D'Amore commented on ZOOKEEPER-1940:
---------------------------------------------

Now there are many sample of zookeeper Dockerfile around.
Many of them are very simple, just standalone docker instances, useful when 
your solrcloud, hbase, whatever needs a zookeeper instance to start.
In some other cases I have found few projects/scripts able to start as an 
ensemble zookeeper cluster.
May be you already know, but start an ensemble with docker it is quite tricky, 
because the ip addresses are dynamically assigned to containers and only when 
they start.
And this goes against the standard zookeeper configuration where the zoo.cfg 
contains the list of instances taking part of an ensemble.

So usually you cannot create the zoo.cfg file before the docker instances are 
started. 
One of the most used solutions is to start the docker containers with a scripts 
that waits for a zoo.cfg file.
When all the containers are started another script can collect the containers 
ip addresses and write a zoo.cfg file inside the containers. 

I have created a docker instance useful to create a standalone instance as well 
as an ensemble cluster.
This project was built primarily because I need to test many SolrCloud cluster 
configurations.

https://github.com/freedev/solrcloud-zookeeper-docker

I also know there are no official zookeeper and solrcloud builds available in 
docker registry. 
IMHO, there are still few things to do, but this work could fit an empty space.

> Integrate with Docker.
> ----------------------
>
>                 Key: ZOOKEEPER-1940
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1940
>             Project: ZooKeeper
>          Issue Type: Wish
>            Reporter: David Medinets
>            Priority: Trivial
>
> Docker is an open platform for developers and sysadmins to build, ship, and 
> run distributed applications.
> It's become quite popular and I'd like to see the zookeeper community suggest 
> a standard way to run zookeeper inside docker containers. To get the 
> conversation started, I have a working example at:
> https://github.com/medined/docker-zookeeper
> I hope there is a better technique that I used. And if there is please make 
> suggestions.
> The difficulty, I think, posed by Docker, is that the images are started 
> before the bridge network is created. This means, again I think, that 
> zookeeper is running inside the container with no way to communicate with the 
> ensemble for some non-trivial amount of time. 
> My resolution to this was to force each each to wait 30 seconds before  
> starting zookeeper. I still see connection errors in the logs, but eventually 
> the cluster settles and everything seems to work.
> I'm hoping that someone which more networking experience than I can find a 
> way to eliminate that 30 second delay and the connection errors during 
> startup.
> Thanks for reading this far.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to