使用JDK自帶jvisualvm監控tomcat和java程式
阿新 • • 發佈:2019-01-25
# cd $CATALINA_HOME/conf/
# cp $JAVA_HOME/jre/lib/management/jmxremote.password.template jmxremote.password
# chmod 700 jmxremote.password (一定注意這個檔案預設是不可寫的)
# vi $CATALINA_HOME/conf/jmxremote.password
在最下面新增一個使用者(第一個是使用者名稱 第二個是密碼)
jiu 123456
# chmod 400 jmxremote.password (要求該檔案是任何使用者均不可寫的)
# cp $JAVA_HOME/jre/lib/management/jmxremote.access jmxremote.access
# vi jmxremote.access (該檔案是對jmx使用者的授權)
到最後一行 將
monitorRole readonly
controlRole readwrite
註釋 更改為
# monitorRole readonly
# controlRole readwrite
然後在最後新增一行
jiu readwrite
# chmod 400 jmxremote.access
# cp $JAVA_HOME/jre/lib/management/jmxremote.password.template jmxremote.password
# chmod 700 jmxremote.password (一定注意這個檔案預設是不可寫的)
# vi $CATALINA_HOME/conf/jmxremote.password
在最下面新增一個使用者(第一個是使用者名稱 第二個是密碼)
jiu 123456
# chmod 400 jmxremote.password (要求該檔案是任何使用者均不可寫的)
# cp $JAVA_HOME/jre/lib/management/jmxremote.access jmxremote.access
# vi jmxremote.access (該檔案是對jmx使用者的授權)
到最後一行 將
monitorRole readonly
controlRole readwrite
註釋 更改為
# monitorRole readonly
# controlRole readwrite
然後在最後新增一行
jiu readwrite
# chmod 400 jmxremote.access