jmx tomcat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

export TOMCAT_USER="tomcat"
export JAVA_OPTS="-Xms4096m -Xmx4096m -XX:+UseG1GC -XX:MaxGCPauseMillis=300 -server -XX:+DisableExplicitGC -Dqnr.logs=$CATALINA_BASE/logs -Dqnr.cache=$CATALINA_BASE/cache -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:$CATALINA_BASE/logs/gc.log
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/q/www/mobiledcs-hbase-server/temp/oom
-Djava.rmi.server.hostname=10.90.14.87
-Dcom.sun.management.jmxremote.port=1098
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=/home/q/java/default/jre/lib/management/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=/home/q/java/default/jre/lib/management/jmxremote.access"
# export JAVA_OPTS="-Xms4096m -Xmx4096m -XX:NewSize=512m -XX:PermSize=512m -server -XX:+DisableExplicitGC -Dqnr.logs=$CATALINA_BASE/logs -Dqnr.cache=$CATALINA_BASE/cache -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:$CATALINA_BASE/logs/gc.log
# -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/q/www/mobiledcs-hbase-server/temp/oom
# -Djava.rmi.server.hostname=10.90.14.87
# -Dcom.sun.management.jmxremote.port=1098
# -Dcom.sun.management.jmxremote.ssl=false
# -Dcom.sun.management.jmxremote.authenticate=true
# -Dcom.sun.management.jmxremote.password.file=/home/q/java/default/jre/lib/management/jmxremote.password
# -Dcom.sun.management.jmxremote.access.file=/home/q/java/default/jre/lib/management/jmxremote.access"
chown -R tomcat:tomcat $CATALINA_BASE/logs
chown -R tomcat:tomcat $CATALINA_BASE/cache
chown -R tomcat:tomcat $CATALINA_BASE/conf
chown -R tomcat:tomcat $CATALINA_BASE/work
chown -R tomcat:tomcat $CATALINA_BASE/temp




/home/q/java/default/jre/lib/management/jmxremote.password
monitorRole 1qaz@WSX
controlRole 1qaz@WSX

/home/q/java/default/jre/lib/management/jmxremote.access
monitorRole readonly
controlRole readwrite \
create javax.management.monitor.*,javax.management.timer.* \
unregister