This article is a mirror article of machine translation, please click here to jump to the original article.

View: 33664|Reply: 1

[Source] Java JMX is simple to understand and use

[Copy link]
Posted on 6/25/2021 10:40:59 AM | | | |
JMX stands for Java Management Extensions, which translates to Java Management Extensions, which are used to manage and monitor Java programs. The most commonly used is the monitoring and management of the JVM, such as JVM memory, CPU usage, thread count, garbage collection, etc. In addition, it can also be used as a dynamic modification of the log level, for example, log4j supports JMX to dynamically modify the log level of online services. The most important ones are also used for various monitoring tools, such as Spring Boot Actuator, JConsole, VisualVM, etc. mentioned at the beginning of the article.

JMX is not only a standard, a specification, but also an interface and a framework for the Java management system. There are standards and specifications for developers to customize and develop their own extensions, and as a framework, the JDK has helped us implement common functions, especially the monitoring and management of the JVM.

Connect using jconsole

jconsole is a built-in tool for JDK, and after configuring the JDK environment, we only need to enter it in the cmd command linejconsoleCan. As shown below:



Connect using RMI

RMI is generally used to connect to remote services, but of course local processes can also be used. This is also the first step in connecting remote service clients. When we registered MBean, did you notice that after the registration is completed, there is a large piece of code, which is used to open the RMI connection, open port 8999 as the RMI access port, and then the client can connect with a fixed connection string.

The format of the connection stringservice:jmx:rmi:///jndi/rmi://host:port/jmxrmi



Take Kafka as an example, as follows:

service:jmx:rmi:///jndi/rmi://192.168.1.182:9988/jmxrmi







Previous:Detailed explanation of Kafka configuration parameters
Next:Kafka configures JMX remote monitoring
 Landlord| Posted on 6/25/2021 10:42:05 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com