1、pom引用
com.alibaba
druid
1.1.4
2、java工程spring配置数据源及日志记录,spring配置信息如下
3、java工程启动时的启动参数
-Djava.net.preferIPv4Stack=true
-Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=10.8.3.221
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
4、web监控配置,web.xml配置如下
DruidWebStatFilter
com.alibaba.druid.support.http.WebStatFilter
exclusions
*.js,*.gif,*.jpg,*.png,*.css,*.ico,*.jsp,/druid/*,/download/*
sessionStatMaxCount
2000
sessionStatEnable
true
principalSessionName
session_user_key
profileEnable
true
DruidWebStatFilter
/*
DruidStatView
com.alibaba.druid.support.http.StatViewServlet
resetEnable
true
loginUsername
druid
loginPassword
druid
jmxUrl
service:jmx:rmi:///jndi/rmi://10.8.3.221:9004/jmxrmi
DruidStatView
/druid/*
5、监控web访问路径,用户名druid,密码druid
http://10.8.3.221:8080/projectName/druid/index.html
详细内容见:http://note.youdao.com/noteshare?id=d9c15b09f9b462bf7bc5a7e29deb6e06&sub=04EDF54EEFFB45BBA9B07606871FA58E