Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Exhibitor docker container #374

Open
bitchkat opened this issue Apr 10, 2018 · 3 comments
Open

Exhibitor docker container #374

bitchkat opened this issue Apr 10, 2018 · 3 comments

Comments

@bitchkat
Copy link

bitchkat commented Apr 10, 2018

Does anyone have an updated docker container for exhibitor? The old netflixoss/exhibitor:1.5.2 launches but uses pretty outdated versions of docker and exhibitor.

Locally I package zookeeper and exhibitor as rpms and create a base container that sets up Centos 7.4 with my local yum repo configured. I use the following docker file:

FROM company/companybase:latest

RUN yum -y install zookeeper exhibitor &&\
    mkdir /exhibitor &&\
    chown zookeeper:zookeeper /exhibitor

EXPOSE 2181 2888 3888 8080

ENV ZOO_LOG_DIR=/var/log/zookeeper

WORKDIR /exhibitor

ADD --chown=zookeeper:zookeeper zoo.cfg /etc/zookeeper

ADD --chown=zookeeper:zookeeper exhibitor.properties /exhibitor/exhibitor.properties

USER zookeeper:zookeeper

RUN echo "com.netflix.servers-spec=S:1:$(hostname)" >> /exhibitor/exhibitor.properties

ENTRYPOINT ["java", "-jar", "/usr/share/java/exhibitor/exhibitor-1.6.0.jar", "-c", "file"]

and my exhibitor.properties looks like

com.netflix.exhibitor.zookeeper-data-directory=/var/lib/zookeeper/data
com.netflix.exhibitor.cleanup-period-ms=200000
com.netflix.exhibitor.zookeeper-install-directory=/usr/lib/zookeeper
com.netflix.exhibitor.check-ms=2000
com.netflix.exhibitor.client-port=2181
com.netflix.exhibitor.cleanup-max-files=10
com.netflix.exhibitor.connect-port=2888
com.netflix.exhibitor.observer-threshold=3
com.netflix.exhibitor.election-port=3888
com.netflix.exhibitor.zoo-cfg-extra=syncLimit\=5&tickTime\=2000&initLimit\=10
com.netflix.exhibitor.auto-manage-instances-settling-period-ms=10000
com.netflix.exhibitor.auto-manage-instances=0
com.netflix.exhibitor.log4j-properties=log4j.rootLogger=INFO, CONSOLE \
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender\n\
    log4j.appender.CONSOLE.Threshold=INFO \n\
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout \n\
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n

I run the container via

docker run -d -p 8080:8080 -p 2181:2181 --name exhibitor company/zookeeper

It goes through a lengthy cycle of starting zookeeper, killing it, until it deems it running:

On the Control Panel it will show server id -1 and status serving for a brief period and then switch to

and in the docker image there is a zombie process for every zookeeper that was started and stopped.

While its cycling, the config tab always has an empty servers list. When it finally decides that zookeeper is up, the server list is populated with the containers host name.

Any thoughts?

@bitchkat
Copy link
Author

It looks like running docker run with --init makes the container behave a lot better. That causes the zombie processes to be reaped. Without them being reaped, jps output was polluted with entries for the zombie QuorumPeerMain instances.

@thenom
Copy link

thenom commented Dec 19, 2018

Can confirm --init fixed a lot of issues i had. I couldn't work out why the initial startup worked fine but then any change would cause a cascading fail of all zk nodes. It seems the zombie processes caused the running checks to fail and then in turn the start as it found it was still running.

@huangfushun
Copy link

run command in dockerfile is effective during image build only . zookeeper need explicitly server setting in zoo.cfg, it is better to have shell script to inject dynamic parameter from env before exhibitor start

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants