Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Java DNS cache for Zookeeper ensemble on docker #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 3.4.6/centos/7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ RUN yum install -y java-1.7.0-openjdk-headless tar

RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6.tar.gz | tar xzf - -C /opt && mv /opt/zookeeper-3.4.6 /opt/zookeeper

RUN echo "networkaddress.cache.ttl=0" >> /usr/lib/jvm/jre/lib/security/java.security && \
sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /usr/lib/jvm/jre/lib/security/java.security

EXPOSE 2181 2888 3888

VOLUME /tmp/zookeeper

COPY entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 3.4.6/centos/7/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh
#!/bin/bash

# based on https://github.com/apache/zookeeper/blob/trunk/conf/zoo_sample.cfg
cat > /opt/zookeeper/conf/zoo.cfg <<EOF
tickTime=2000
initLimit=10
syncLimit=5
tickTime=${TICK_TIME:-2000}
initLimit=${INIT_LIMIT:-10}
syncLimit=${SYNC_LIMIT:-5}
dataDir=/tmp/zookeeper
clientPort=2181
cnxTimeout=${CNX_TO_MS:-5000}
EOF

# server.1=...
Expand Down
5 changes: 5 additions & 0 deletions 3.4.6/ubuntu/14.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ RUN apt-get update && apt-get install -y curl openjdk-7-jre-headless python

RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6.tar.gz | tar xzf - -C /opt && mv /opt/zookeeper-3.4.6 /opt/zookeeper

RUN echo "networkaddress.cache.ttl=0" >> /etc/java-7-openjdk/security/java.security && \
sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /etc/java-7-openjdk/security/java.security

EXPOSE 2181 2888 3888

VOLUME /tmp/zookeeper

COPY entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 3.4.6/ubuntu/14.04/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh
#!/bin/bash

# based on https://github.com/apache/zookeeper/blob/trunk/conf/zoo_sample.cfg
cat > /opt/zookeeper/conf/zoo.cfg <<EOF
tickTime=2000
initLimit=10
syncLimit=5
tickTime=${TICK_TIME:-2000}
initLimit=${INIT_LIMIT:-10}
syncLimit=${SYNC_LIMIT:-5}
dataDir=/tmp/zookeeper
clientPort=2181
cnxTimeout=${CNX_TO_MS:-5000}
EOF

# server.1=...
Expand Down