Properties pro=System.getProperties();
Enumeration enu2=pro.propertyNames();
while(enu2.hasMoreElements()){
String key = (String)enu2.nextElement();
System.out.println(key +" "+System.getProperty(key));
}
获取所有参数
在tomcat启动的时候加
-Dcom.sun.management.jmxremote.port=25025
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
在其他机器上jconsole,监控这个tomcat
ip:25025
如果是resin
修改conf/resin.conf
注意没有java.rmi.server.hostname连不上
而且linux需要设置/etc/hosts
把127.0.0.1改成真实的实际ip,比如虚拟机 本身的192.168.221.101
Enumeration enu2=pro.propertyNames();
while(enu2.hasMoreElements()){
String key = (String)enu2.nextElement();
System.out.println(key +" "+System.getProperty(key));
}
获取所有参数
在tomcat启动的时候加
-Dcom.sun.management.jmxremote.port=25025
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
在其他机器上jconsole,监控这个tomcat
ip:25025
如果是resin
修改conf/resin.conf
<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.port=9012</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.authenticate=false</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.ssl=false</jvm-arg>
<jvm-arg>-Djava.rmi.server.hostname=192.168.221.101</jvm-arg>
<jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvm-arg>
注意没有java.rmi.server.hostname连不上
而且linux需要设置/etc/hosts
把127.0.0.1改成真实的实际ip,比如虚拟机 本身的192.168.221.101