Last active
January 20, 2017 10:40
-
-
Save megastef/ada049814fdb69ddca5eff296555b99c to your computer and use it in GitHub Desktop.
tomcat monitoring on docker
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
# in-process monitor for Tomcat, needs less resources and no network setup | |
version: '2' | |
services: | |
spm-client: | |
image: sematext/spm-client | |
container_name: spm-client-tc | |
hostname: spm-client-tc | |
environment: | |
# please set env var SPM_TOKEN before you run docker-compose | |
- SPM_CONFIG=${SPM_TOKEN} tomcat javaagent jvmname:default | |
volumes: | |
# spm-client > v1.31.65 requires access to docker socket | |
- /var/run/docker.sock:/var/run/docker.sock | |
tomcat: | |
image: tomcat:latest | |
hostname: tomcat | |
depends_on: | |
- spm-client | |
ports: | |
- "8888:8080" | |
- "3000:3000" | |
environment: | |
- 'CATALINA_OPTS=$CATALINA_OPTS -Dcom.sun.management.jmxremote -javaagent:/opt/spm/spm-monitor/lib/spm-monitor-tomcat.jar=5df036d9-a2d8-4520-ba10-cc991bf891d8::default' | |
volumes_from: | |
- spm-client:rw | |
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
# Standalone monitor for Tomcat, via JMX network connection | |
version: '2' | |
services: | |
spm-client: | |
image: sematext/spm-client | |
container_name: spm-client-tc | |
hostname: spm-client-tc | |
environment: | |
# please set env var SPM_TOKEN before you run docker-compose | |
- SPM_CONFIG=${SPM_TOKEN} tomcat standalone jvmname:default jmxhost:tomcat jmxport:3000 | |
links: | |
- tomcat:tc | |
volumes: | |
# spm-client > v1.31.65 requires access to docker socket | |
- /var/run/docker.sock:/var/run/docker.sock | |
tomcat: | |
image: tomcat:latest | |
hostname: tomcat | |
ports: | |
- "8888:8080" | |
- "3000:3000" | |
environment: | |
- 'CATALINA_OPTS=$CATALINA_OPTS -Djava.rmi.server.hostname=tomcat -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment