JVISUALVM monitoring remote Linux under Tomcat

Source: Internet
Author: User
Tags tomcat server

JVISUALVM monitoring remote Linux under Tomcat

1. Edit tomcat/bin/catalina.sh

Add the following code with no line break in the middle:

catalina_opts= "$CATALINA _opts-djava.rmi.server.hostname=192.168.1.11-dcom.sun.management.jmxremote- dcom.sun.management.jmxremote.port=12345 -dcom.sun.management.jmxremote.ssl=false- Dcom.sun.management.jmxremote.authenticate=true "

You can search for execute with the/string command, adding to the note above the execute the requested command.

Note that hostname is the Tomcat server Ip,port is the monitoring port.

2. Edit Jmxremote.access and Jmxremote.password

These two files are inside the JDK and can be found through the%java_home%/jre/lib/management directory.

There is a jmxremote.password.template file that is renamed to Jmxremote.password, which is the user name password that controls the remote connection.

Then chmod to these two files, chmod 777 file name

Last VI Jmxremote.password, modify the following two lines to remove the note #:

# Monitorrole XXXXXX
# Controlrole XXXXXX

Monitorrole is the view role, with read-only permission, XXXXXX is the password that is set.

Controlrole is the control user, has read and write permissions, XXXXXX is the password set.

Finally, if the firewall is turned on, add the port to the Firewall trust list

Add the following line to the/etc/sysconfig/iptables

-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 12345-j ACCEPT

You can also add them directly with the iptables command.

After you start Tomcat, the 12345 port you just set is on the listening state.

To run on a single server:

Win+r, input JVISUALVM run, start the monitoring interface:

1. Add remote host, remote, enter host ip:192.168.1.11

2. Add a JMX connection to the host right, enter the port number: 12345

User name Controlrole, password xxxxxx

Connection Successful!

JVISUALVM monitoring remote Linux under Tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.