-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metricbeat: Support Jolokia proxy mode (#6475)
- Loading branch information
1 parent
73e3caa
commit 3a61bcf
Showing
8 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
# Tomcat is started to fetch Jolokia metrics from it | ||
FROM jolokia/java-jolokia:7 | ||
ENV TOMCAT_VERSION 7.0.55 | ||
FROM java:8-jdk-alpine | ||
|
||
ENV TOMCAT_VERSION 7.0.86 | ||
ENV TC apache-tomcat-${TOMCAT_VERSION} | ||
ENV JOLOKIA_VERSION 1.5.0 | ||
|
||
RUN apk update;\ | ||
apk add curl | ||
|
||
HEALTHCHECK --interval=1s --retries=90 CMD curl -f curl localhost:8778/jolokia/ | ||
HEALTHCHECK --interval=1s --retries=90 CMD curl -f localhost:8778/jolokia/ | ||
EXPOSE 8778 | ||
RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/${TC}.tar.gz | ||
RUN tar xzf ${TC}.tar.gz -C /opt | ||
|
||
CMD env CATALINA_OPTS=$(jolokia_opts) /opt/${TC}/bin/catalina.sh run | ||
# Prepare a server where jolokia runs in proxy mode | ||
RUN wget http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/${TC}.tar.gz;\ | ||
tar xzf ${TC}.tar.gz -C /usr;\ | ||
rm ${TC}.tar.gz;\ | ||
sed -i -e 's/Connector port="8080"/Connector port="8778"/g' /usr/${TC}/conf/server.xml;\ | ||
wget http://central.maven.org/maven2/org/jolokia/jolokia-war/${JOLOKIA_VERSION}/jolokia-war-${JOLOKIA_VERSION}.war -O /usr/${TC}/webapps/jolokia.war | ||
|
||
# JMX setting to request authentication with remote connection | ||
RUN echo "monitorRole QED" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password;\ | ||
echo "controlRole R&D" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password;\ | ||
chmod 600 /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password | ||
|
||
# Start tomcat to accept JMX connection and enable jolokia proxy mode | ||
CMD env CATALINA_OPTS="$(jolokia_opts)\ | ||
-Dcom.sun.management.jmxremote.port=7091\ | ||
-Dcom.sun.management.jmxremote.ssl=false\ | ||
-Dcom.sun.management.jmxremote.authenticate=true\ | ||
-Dorg.jolokia.jsr160ProxyEnabled" /usr/${TC}/bin/catalina.sh run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters