In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to use jconsole to monitor Tomcat service? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
What is JConsole?
JConsole has been introduced since Java 5. JConsole is a built-in Java performance analyzer that can be run from the command line or in GUI shell. You can easily use JConsole (or its higher-end "next of kin" VisualVM) to monitor Java application performance and track code in Java.
1. Get the address and available port number of the remote server
I have my own Ali CVM. The server address is 39.107.68.142 and the port number is 8696.
Check whether the port number is available: netstat-tunlp | grep 8696
We can see that 6969 of the above has been used and 8696 has not been used.
View the port on which the process is started
Netstat-antup | grep 32594
Check port snooping
Lsof-iRu 1234
two。 Modify the startup script of tomcat to open JMX
Modify the catalina.sh script file to add at the beginning of the file
JAVA_OPTS= "- Djava.rmi.server.hostname=39.107.68.142-Dcom.sun.management.jmxremote.port=8696-Dcom.sun.management.jmxremote.rmi.port=8696-Dcom.sun.management.jmxremote.ssl=false-Dcom.sun.management.jmxremote.authenticate=false"
Among them
-Dcom.sun.management.jmxremote.port=9696 / / connection port, customized not to conflict with existing port
-Dcom.sun.management.jmxremote.rmi.port=8696 / / this sentence must be added. If you do not add it, you cannot succeed.
-Dcom.sun.management.jmxremote.authenticate=false / / login without password
-Dcom.sun.management.jmxremote.ssl=false / / No security certificate is required
-Djava.rmi.server.hostname=39.107.68.142 / / this ip is the public network ip of your own server
Location:
3. Restart the tomcat service
An Error: JMX connector server communication error: service:jmx:rmi://dusk:8696 error may be reported when shutting down the service using shutdown.sh
Just kill the kill-9 process number.
View the process: ps-ef | grep tomcat
Then start the service startup.sh
Use netstat-tunlp | grep 8696 to confirm whether the port is already listening
4. Open port number
If we turn on the firewall, we need to open this port in the firewall.
View firewall status service iptables status
Open Port:
(1) enter the editor through vi / etc/sysconfig/iptables and add-An INPUT-p tcp-m tcp-- dport 8889-j ACCEPT
(2) restart the iptables service by executing the / etc/init.d/iptables restart command
If it is an Ali CVM, you also need to open the port in the security group:
5. Open the local jconsole monitoring remote service
In the remote process, enter: 39.107.68.142 purl 8696 Click the connection
Then you can check the JVM permission status.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.