oracle jrockit r,Oracle JRockit Mission Control

Oracle JRockit Mission Control

发布时间:2020-06-20 21:10:09

来源:51CTO

阅读:324

作者:caidui

用于分析jrockit虚拟机性能,可以实时监控性能,分析内存使用等等,现在的版本上面有很详细的帮助,还TMD中文的,感谢甲骨文。

服务器端配置简单,就是配置JMX

1.准备访问控制的.access和.password文件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项目

本回完

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值