通过jconsole查看tomcat运行情况的配置方法——基于JDK1.5、Linux(Redhat5.5)、Tomcat6

时间:2024.4.7

通过 jconsole查看tomcat运行情况的配置方法

——基于JDK1.5、Linux(Redhat5.5)、Tomcat6

由于项目的原因,需要使用jconsole对tomcat进行远程监控,结合网上的资料对配置方法进行了总结。

第一步、配置tomcat

打开%TOMCAT_HOME%/bin下的文件catalina.sh,搜索“JAVA_OPTS”找到下面这行:

在每个“JAVA_OPTS”后边都添加以下标黄代码段,且在一行显示

其中-Djava.rmi.server.hostname项必须设置,否则远程连接会因为解析到127.0.0.1失败,该项的值就是你在windows客户端连接linux时的ip地址

-Dcom.sun.management.jmxremote.port="9004"项设置远程连接端口,不要与其他应用冲突

ssl和authenticate设置为false,如果需要安全,请不要false

第二步、重启tomcat

使用root身份登录系统,进入%TOMCAT_HOME%/bin目录下:

第三步、运行jconsole

进入JDK安装目录%JDK_HOME%/bin下,找到“jconsole.exe”,点击运行并选择【远程】选项卡:

在【主机名或ip】输入要远程监控的tomcat服务器地址

在【端口】输入上文设置的端口号:9004

【用户名、口令】为空,点击【连接】进入监控界面:


第二篇:jconsole远程配置方法


root@suntest # pwd

/usr/tomcat1

root@suntest # cd bin

root@suntest # ls

D:\JIRA\attachment catalina.sh jsvc.tar.gz shutdown.bat tomcat-native.tar.gz version.bat

atlassian-jira.log commons-daemon.jar nohup.out shutdown.sh tomcat6.exe version.sh

bootstrap.jar cpappend.bat service.bat startup.bat tomcat6w.exe

catalina-tasks.xml digest.bat setclasspath.bat startup.sh tool-wrapper.bat

catalina.bat digest.sh setclasspath.sh tomcat-juli.jar tool-wrapper.sh

root@suntest #

修改 catalina.sh

root@suntest # vi catalina.sh

添加如下内容:

CATALINA_OPTS="-Djava.rmi.server.hostname=10.26.219.188

-Dcom.sun.management.jmxremote.port=4456

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.ssl=false"

进入java的管理目录

root@suntest # cd /usr/jdk/instances/jdk1.5.0/jre/lib/management

root@suntest # ls

jmxremote.access jmxremote.password.template management.properties

jmxremote.password management.jmxremote.password snmp.acl.template

建立以下文件:jmxremote.password(通过模版文件copy建立)并给与访问权限

root@suntest #chmod 600 jmxremote.password

root@suntest # vi jmxremote.password

添加以下内容:

monitorRole monitor (用户名 密码)

controlRole monitor

重新启动TOMCAT

root@suntest # nohup ./startup.sh

Sending output to nohup.out

root@suntest # ps -ef|grep tomc

root 25828 1 0 16:05:55 pts/4 1:32 /usr/jdk/instances/jdk1.5.0/bin/java

-Djava.util.logging.config.file=/usr/tomca

root 25883 1 9 16:17:38 pts/4 0:13 /usr/jdk/instances/jdk1.5.0/bin/java -Djava.util.logging.config.file=/usr/tomca

root 25884 25235 0 16:17:45 pts/4 0:00 grep tomc

客户端:找到自己机器的jconsole.exe运行后:

jconsole远程配置方法

填入远程ip端口和用户名密码连接就可以了

更多相关推荐:
Diogenes and Alexander 翻译

Lesson18DiogenesandAlesander他躺在光溜溜的地上赤着脚胡子拉茬的半裸着身子模样活像个乞丐或疯子可他就是他而不是别的什么人大清早他随着初升的太阳睁开双眼搔了搔痒便像狗一样在路边解手他在公...

Diogenes and Alexander 戴奥吉尼斯和亚历山大

GilbertHighetThisarticlebythelateclassicistGilbertHighetdescribesameetingbetweentwosharplycontrastingpers...

Diogenes and Alexander retelling第欧根尼和亚历山大

ThepassagecanbedevidedintotwopartsthefirstparttalksaboutDiogenesthesecondpartisaboutDiogenes39meetingwithAlexanderI...

大学英语(四)Diogenes and Alexander 戴奥吉尼斯和亚历山大

DiogenesandAlexander戴奥吉尼斯和亚历山大TheDogHasHisDayGilbertHighetThisarticlebythelateclassicistGilbertHighetdesc...

Thoughts After Diogenes and Alexander

TheQuestThatNeverEndsThisessayontheencounterofDiogenesandAlexanderisreallythoughtprovokingIknewalittleabouttheDoggi...

Diogenes_and_Alexander__戴奥吉尼斯和亚历山大

GilbertHighetThisarticlebythelateclassicistGilbertHighetdescribesameetingbetweentwosharplycontrastingpers...

Diogenes and Alexander

DiogenesandAlexanderLyingonthebareearthshoelessbeardedhalfnakedhelookedlikeabeggaroralunaticHewasonebutnottheotherH...

What made Alexander the Great

WhatmadeAlexandertheGreatAbstractAlexanderofMacedonknownasAlexandertheGreatwasaGreekkingofMacedonHewasthefirstkingt...

Diogense and Alexander

01LyingonthebareearthshoelessbeardedhalfnakedhelookedlikeabeggaroralunaticHewasonebutnottheotherHehadopenedhiseyesw...

The Paraphrase of Units 现代大学英语精读3单元重点句子

Unit1YourCollegeYears123456789Unit2HowReadingChangedMyLife12345678937Unit4DiogenesandAlexander12withafewhandfulsofw...

introductions of Diogenes and Alexander

introductionsofDiogenesandAlexander1TheworldsgreatestCynicDiogeneswasbornin412BCEinSinopeacityontheBlackSeaAsayoung...

Diogenes and Alexander

DiogenesandAlexander1LyingonthebareearthshoelessbeardedhalfnakedhelookedlikeabeggaroralunaticHewasonebutnottheother...

diogenes and alexander读后感(13篇)