jvisualvm遠程監控tomcat

 

一、在 $CATALINA_HOME/bin/startup.sh 倒數第二行(也就是exec "$PRGDIR"/"$EXECUTABLE" start "$@"一行上邊)加上以下內容:html

export CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=192.168.1.130
-Dcom.sun.management.jmxremote.port=7003
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access"

  

-Dcom.sun.management.jmxremote 啓用JMX遠程監控
-Djava.rmi.server.hostname=192.168.1.130  這是鏈接你的tomcat服務器地址
-Dcom.sun.management.jmxremote.port=7003  jmx鏈接端口
-Dcom.sun.management.jmxremote.ssl=false  是否ssl加密
-Dcom.sun.management.jmxremote.authenticate=true  遠程鏈接須要密碼認證
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password  指定鏈接的用戶名和密碼配置文件
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access  指定鏈接的用戶所擁有權限的配置文件

  二、在$CATALINA_HOME/conf/jmxremote.access裏添加能夠鏈接監控的用戶名以及權限:java

monitorRole readonly
controlRole readwrite

  三、在$CATALINA_HOME/conf/jmxremote.password 裏添加能夠鏈接監控的用戶名以及密碼,用戶的權限在jmxremote.access裏以及配置了:tomcat

monitorRole  111111
controlRole   222222

  四、修改jmxremote.access和jmxremote.password的權限:服務器

sudo chmod 600 jmx*

  五、重啓tomcat就能夠了加密

 

轉自https://www.cnblogs.com/leocook/p/jvisualvmandtomcat.htmlserver

相關文章
相關標籤/搜索