资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

OracleJRockitMissionControl

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

黎川ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!

mkdir -p /etc/jre_accesscp $JAVA_HOME/jre/lib/management/jmxremote.password.template /etc/jre_access/jmxremote.passwordcp $JAVA_HOME/jre/lib/management/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   readonly#controlRole   readwrite \#              create javax.management.monitor.*,javax.management.timer.* \#              unregisterusername  readwrite
 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项目差不多,采用的是yum安装的Tomcat/7.0.39
直接贴到tomcat7.conf里的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="$JAVA_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/init.d/tomcat7# 修改TOMCAT_CFG部分# Get the tomcat config (use this for environment specific settings)TOMCAT_CFG_start="/etc/tomcat7/tomcat7_start.conf"if [ -r "$TOMCAT_CFG_start" ]; then
    . $TOMCAT_CFG_startfi TOMCAT_CFG_stop="/etc/tomcat7/tomcat7_stop.conf"if [ -r "$TOMCAT_CFG_stop" ]; then
    . $TOMCAT_CFG_stopfi # 修改function parseOptions()function parseOptions_start() {
    options=""
    options="$options $(
                 awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \                 $TOMCAT_CFG_start
             )"
    if [ -r "/etc/sysconfig/${NAME}" ]; then
        options="$options $(
                     awk '!/^#/ && !/^$/ { ORS=" ";
                                           print "export ", $0, ";" }' \                     /etc/sysconfig/${NAME}
                 )"
    fi
    TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"} function parseOptions_stop() {
    options=""
    options="$options $(
                 awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \                 $TOMCAT_CFG_stop
             )"
    if [ -r "/etc/sysconfig/${NAME}" ]; then
        options="$options $(
                     awk '!/^#/ && !/^$/ { ORS=" ";
                                           print "export ", $0, ";" }' \                     /etc/sysconfig/${NAME}
                 )"
    fi
    TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"} #修改function start和stop内调用的parseOptionsfunction start() {...
    parseOptions_start
...} function stop() {...
    parseOptions_stop
...} #修改stop参数,执行两次
    stop)
        stop >> /dev/null 2>&1
        stop        ;;

这样客户端就可以通过Oracle JRockit Mission Control 连接监控JVM项目
本回完


本文标题:OracleJRockitMissionControl
本文链接:http://cdkjz.cn/article/ppedci.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220