1. 启用web admin tool
<user username="admin" password="tomcat" roles="admin,manager"/>
管理url:
2. 使用jconsole查看
将下面语句加在 startup.sh 最后一行exec "$PRGDIR"/"$EXECUTABLE" start "$@" 之前
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8849 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
3. 实时查看tomcat线程数
netstat -anlt|grep 80 |grep ESTABLISHED
4. 查看数据库连接情况
show processlist; 或者查询information_schema实现 SELECT user, host, time, command, time FROM [mysql|information_schema].processlist WHERE user = 'me' and state IS NOT NULL;
show errors;