首页 > 代码库 > 采用JavaMelody监控Tomcat服务——安装手册
采用JavaMelody监控Tomcat服务——安装手册
#1.获取安装包
wget https://psi-probe.googlecode.com/files/probe-2.3.3.zip
#2.解压安装包
unzip probe-2.3.3.zip
mv probe.war <tomcat dir>/webapps
mv probe.war <tomcat dir>/webapps
#3.设置tomcat用户信息
vi <tomcat dir>/conf/tomcat-users.xml
--------------------------------------------------------------------------------
<?xml version=‘1.0‘ encoding=‘utf-8‘?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="standard"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="probe" password="probe" roles="admin,manager"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
<tomcat-users>
<role rolename="manager"/>
<role rolename="standard"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="probe" password="probe" roles="admin,manager"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
--------------------------------------------------------------------------------
#注:直接用此内容替换tomcat-users.xml文件内容
#修改后用户名密码均为tomcat
#4.设置环境变量,获取服务器状态
# vi /etc/profile
JAVA_OPTS=-Dcom.sun.management.jmxremote
export JAVA_OPTS
JAVA_OPTS=-Dcom.sun.management.jmxremote
export JAVA_OPTS
#5.javamelody和web应用集成时web.xml配置
- <listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
<filter>
<filter-name>monitoring</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>monitoring</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
采用JavaMelody监控Tomcat服务——安装手册
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。