甲骨文JRockit任务控制

  

  

用于分析jrockit虚拟机性能,可以实时监控性能,分析内存使用等等,现在的版本上面有很详细的帮助,还TMD中文的,感谢甲骨文。
服务器端配置简单,就是配置JMX
1。准备访问控制的.access和。密码文件

mkdir  -p /etc/jre_accesscp  $ JAVA_HOME/jre/lib/管理/jmxremote.password.template /etc/jre_access/jmxremote.passwordcp  $ JAVA_HOME/jre/lib/管理/jmxremote.access /etc/jre_access/jmxremote.accessvi /etc/jre_access jmxremote.password #,…#, monitorRole , QED #, controlRole ,, R& Dusername , userpasswd   ,vi /etc/jre_access jmxremote.access # # monitorRole ,,只读的# controlRole ,, readwrite  \ #,,,,,,,,,,,,,, create  javax.management.monitor。*, javax.management.timer。*, \ #,,,,,,,,,,,,,, unregisterusername 读写   ,chmod  600年,/etc/jre_access/jmxremote.passwordchmod  644年,/etc/jre_access jmxremote.access

2。添加启动jmx类

# jport=开启的监控端口# SERVERIP=服务所在服务器IP $ JAVA_HOME/bin/java  -Dcom.sun.management.jmxremote.port=$ jport  -Dcom.sun.management.jmxremote.ssl=false  -Dcom.sun.management.jmxremote.authenticate=true  -Dcom.sun.management.jmxremote.access.file=/etc/jre_access/jmxremote.access  -Dcom.sun.management.jmxremote.password.file=/etc/jre_access/jmxremote.password  -Djava.rmi.server.hostname=$ SERVERIP ……#接JAVA项目参数

3。tomcat添加JMX监控
和java项目差不多,采用的是百胜安装的tomcat/7.0.39
直接贴到tomcat7。配置里的JAVA_OPTS里面能够启动,但关闭蛋疼不能用,去掉参数就可以关闭
无奈把tomcat7.conf换成两份tomcat7_start.conf, tomcat7_stop.conf,并修改/etc/init。d/tomcat7

# - - - - - - - - - - - - #贴代码# - - - - - - - - - - -cp /etc/tomcat7/tomcat7.conf /etc/tomcat7/tomcat7_start.confcp /etc/tomcat7/tomcat7.conf /etc/tomcat7/tomcat7_stop.conf   ,vi /etc/tomcat7 tomcat7_start.conf #,添加如下内容. . JAVA_OPTS=癑AVA_OPTS 美元;-verbosegc  -Dcom.sun.management.jmxremote.port=7091, -Dcom.sun.management.jmxremote.ssl=false  -Dcom.sun.management.jmxremote.authenticate=true  -Dcom.sun.management.jmxremote.access.file=/etc/jre_access/jmxremote.access  -Dcom.sun.management.jmxremote.password.file=/etc/jre_access/jmxremote.password , -Djava.rmi.server.hostname=218.58.x.x ”, vi /etc/摆在tomcat7 #,修改TOMCAT_CFG部分#,Get 从而tomcat  config  (use 却;能够for  environment  specific 设置)TOMCAT_CFG_start="/etc/tomcat7/tomcat7_start.conf”if  [, -r “TOMCAT_CFG_start美元”,),然后   ,,,只TOMCAT_CFG_startfi 美元;TOMCAT_CFG_stop="/etc/tomcat7/tomcat7_stop.conf”if  [, -r “TOMCAT_CFG_stop美元”,),然后   ,,,只TOMCAT_CFG_stopfi 美元;#,修改function  parseOptions () function  parseOptions_start (), {   ,,,选项=" "   ,,,选项=" options (美元   ,,,,,,,,,,,,,,,,awk “!/^ #/,,,, !/^ $/,{,口服补液盐=",";,print “export ”, 0美元,”;“,}’,、,,,,,,,,,,,,,,,,,TOMCAT_CFG_start美元   ,,,,,,,,,,,,)   ,,,if  [, -r “/etc/sysconfig/${名称}",),然后   ,,,,,,,选项=" options (美元   ,,,,,,,,,,,,,,,,,,,,awk  '/^ # !/,,,, !/^ $/,{,口服补液盐=",";   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,print “export ”, 0美元,”;“,”}\大敌;,,,,,,,,,,,,,,,,,,,,/etc/sysconfig/${名称}   ,,,,,,,,,,,,,,,,)   ,,fi   ,,,TOMCAT_SCRIPT=" $ options  $ {TOMCAT_SCRIPT}”}, function  parseOptions_stop (), {   ,,,选项=" "   ,,,选项=" options (美元   ,,,,,,,,,,,,,,,,awk “!/^ #/,,,, !/^ $/,{,口服补液盐=",";,print “export ”, 0美元,”;“,}’,、,,,,,,,,,,,,,,,,,TOMCAT_CFG_stop美元   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

甲骨文JRockit任务控制