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

39: add jolokia for zookeeper monitoring #40

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ENV \
EXHIBITOR_POM="https://raw.githubusercontent.com/soabase/exhibitor/master/exhibitor-standalone/src/main/resources/buildscripts/standalone/maven/pom.xml" \
BUILD_DEPS="maven openjdk-7-jdk+"

ENV JOLOKIA_VERSION="1.3.7"

RUN export DEBIAN_FRONTEND=noninteractive \
# Install dependencies
&& echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend \
Expand Down Expand Up @@ -44,7 +46,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \
&& rm -rf /var/lib/apt/lists/* /root/.m2

# Base part of dockerfile should not be modified not to rebuild image for 1 hour
ENV JOLOKIA_VERSION="1.3.7"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of moving this variable up? The install here takes time and reordering commands will cause longer rebuild

RUN wget -q -O /opt/jolokia-jvm-${JOLOKIA_VERSION}-agent.jar "http://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/${JOLOKIA_VERSION}/jolokia-jvm-${JOLOKIA_VERSION}-agent.jar"

RUN ln -sf /dev/stdout /opt/zookeeper/zookeeper.out
Expand All @@ -57,6 +58,6 @@ COPY scm-source.json /scm-source.json
WORKDIR ${HOME}
USER ${USER}

EXPOSE 2181 2888 3888 8181 8778
EXPOSE 2181 2888 3888 8181 8778 8779
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


ENTRYPOINT ["bash", "-ex", "/opt/exhibitor/run.sh"]
1 change: 1 addition & 0 deletions exhibitor.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ election-port=3888
zoo-cfg-extra=tickTime\=2000&initLimit\=10&syncLimit\=5&quorumListenOnAllIPs\=true
auto-manage-instances-settling-period-ms=0
auto-manage-instances=1
java-environment=#!/bin/bash \nexport JAVA_TOOL_OPTIONS="-javaagent:/opt/jolokia-jvm-${JOLOKIA_VERSION}-agent.jar=port=8779,host=0.0.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain what is java-environment and how this thing is used? I failed to find documentation for it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of java-environment is placed in Config -> Ensemble -> java.env script. It is "Script to write as the “java.env” file which gets executed as part of the ZooKeeper start script. Optional – leave blank for no file." docs

2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fi

exec 2>&1

java -javaagent:/opt/jolokia-jvm-1.3.7-agent.jar=port=8778,host=0.0.0.0 -jar /opt/exhibitor/exhibitor.jar \
java -javaagent:/opt/jolokia-jvm-${JOLOKIA_VERSION}-agent.jar=port=8778,host=0.0.0.0 -jar /opt/exhibitor/exhibitor.jar \
--port 8181 --defaultconfig exhibitor.conf \
--configtype $CONFIG_TYPE \
--hostname ${HOSTNAME} \
Expand Down