Summary
Tomcat configuration JMX and related instructions in centos 6.5 environment
Regardless of whether it is the Windows version or the Linux version of Tomcat's personalized parameter configuration (including JMX), the official Tomcat recommended way is to create a new setenv.sh (Linux) or setenv.bat (Windows) script in the Tomcat installation directory/bin to configure. Instead of configuring in tomcat's own script.
vi setenv.sh
#! /bin/sh
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access"
Parameter Description:
#! /bin/sh
# Author by itunic
#
# Enable Tomcat JMX connection.
CATALINA_OPTS=-Dcom.sun.management.jmxremote
#
# Set the JMX URL host name or IP address.
- Djava.rmi.server.hostname=172.16.8.62
#
# Set JMX listening port
- Dcom.sun.management.jmxremote.port=8849
#
# Set SSL authorization, the value is true or false;-Dcom.sun.management.jmxremote.ssl=false
#
# Set password for login, the value is true or false;If authorization is required, add the following configuration
# - Dcom.sun.management.jmxremote.authenticate=false
#
# Edit in$CATALINA_BASE / conf / jmxremote.access:-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
#
# Edit password file$ CATALINA_BASE / conf / jmxremote.password:-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access
Then create a new jmxremote.password and jmxremote.access file under Tomcat installation/conf, the file name must be named like this.
vi jmxremote.access
# Set user name and permissions
# readonly
# readwrite
# Note: There are only these two permissions, the others do not take effect
monitorRole readonly
controlRole readwrite
vi jmxremote.password
# Set the user name and password, the user name and password must be consistent with the access file
monitorRole tomcat
controlRole tomcat
Set the permissions of the jmxremote.password file
Set the operating system hosts mapping, and add the corresponding relationship between the ip to be accessed and the machine name.
# View operating system name
hostname
# View operating system ip
ifconfig
# Set the host correspondence
vi /etc/hosts
192.168.1.2 hostname
test
Use jdk's own jmx monitoring tool jConsole to test whether the configuration is correct
Connection method:
Recommended Posts