虚拟机添加参数
nohup java -server -Xmx4g -Xms4g -XX:+PrintGCDetails -Xloggc:/root/bin/log/gc.log \
-Dcom.sun.management.jmxremote=true \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.port=9010 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.rmi.port=9011 \
-jar cardgame.jar >game.log &
开始始终连不上
无法使用 service:jmx:rmi:///jndi/rmi://xxx.xx.x.xxx:9010/jmxrmi
后添加参数 指定ip 最终连上
nohup java -server -Xmx4g -Xms4g -XX:+PrintGCDetails -Xloggc:/root/bin/log/gc.log \
-Dcom.sun.management.jmxremote=true \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.port=9010 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.rmi.port=9011 \
-Djava.rmi.server.hostname=xxx.xx.xx.xxx \
-jar cardgame.jar >game.log &
本文介绍了如何通过Java Management Extensions (JMX) 连接远程服务器。在初始尝试中遇到连接问题,通过为虚拟机添加特定参数并指定服务器IP,最终成功实现了远程连接。
6505

被折叠的 条评论
为什么被折叠?



