From 1b7d6a2475a99547867d55848e59842dae6fcd62 Mon Sep 17 00:00:00 2001 From: Olga Casian Date: Thu, 28 Sep 2017 11:55:35 +0200 Subject: [PATCH 1/2] 39: add jolokia for zookeeper monitoring --- Dockerfile | 5 +++-- exhibitor.conf.tmpl | 1 + run.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 314232e..310ff4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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" 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 @@ -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 ENTRYPOINT ["bash", "-ex", "/opt/exhibitor/run.sh"] diff --git a/exhibitor.conf.tmpl b/exhibitor.conf.tmpl index 74ff852..1abf77c 100644 --- a/exhibitor.conf.tmpl +++ b/exhibitor.conf.tmpl @@ -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" diff --git a/run.sh b/run.sh index 2e3ec24..679fa63 100755 --- a/run.sh +++ b/run.sh @@ -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} \ From 2d1e4908b5e546efefdd3cabaf248bcb3d1ecd8c Mon Sep 17 00:00:00 2001 From: Olga Casian Date: Thu, 5 Oct 2017 17:53:44 +0200 Subject: [PATCH 2/2] 39: after review --- Dockerfile | 3 +-- exhibitor-appliance.yaml | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 310ff4a..85a8752 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,6 @@ 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 \ @@ -46,6 +44,7 @@ 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" 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 diff --git a/exhibitor-appliance.yaml b/exhibitor-appliance.yaml index 0ac2403..c5720e1 100644 --- a/exhibitor-appliance.yaml +++ b/exhibitor-appliance.yaml @@ -49,6 +49,7 @@ SenzaComponents: 3888: 3888 8181: 8181 8778: 8778 + 8779: 8779 root: True environment: S3_BUCKET: "{{Arguments.ExhibitorBucket}}" @@ -110,6 +111,10 @@ Resources: FromPort: 8778 ToPort: 8778 CidrIp: 0.0.0.0/0 + - IpProtocol: tcp + FromPort: 8779 + ToPort: 8779 + CidrIp: 0.0.0.0/0 ExhibitorLoadBalancer: Type: AWS::ElasticLoadBalancing::LoadBalancer Properties: