Jconsole monitors remote weblogic and tomcat

Source: Internet
Author: User
Tags jconsole

Jconsole monitors remote weblogic and tomcat

Jconsole can monitor the memory usage of java processes on the remote host. This article explains how to use jconsole to monitor weblogic and tomcat on a remote host.

I. Environment

1. Local Environment: windows xp + jconsole (jdk1.6)

2. Remote Environment 1: sunos (solaris, jdk1.6) + weblogic

3. Remote Environment 2: redhat (jdk1.6) + tomcat

This article describes the configurations in two environments. The configurations are basically the same, and the configurations of other systems are similar.

2. remote connection to sunos (solaris) + weblogic

1. jconsole uses jmx for monitoring. You need to configure the startup parameters when the application is started. Because the weblogic Server is used, you need to configure it in the $ {DOMAIN_HOME}/bin/setDomainEnv. sh environment.

JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote.port=9000"JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote.authenticate=false"JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote.ssl=false"
2. Check/etc/hosts. By default, the hostname has been mapped to the ip address, so no adjustment is required.
::1          localhost127.0.0.1    localhost10.1.97.20   c20 c20.sinosure.com.cn loghost

3. Modify the directory attributes of $ {JAVA_HOME}/jre/lib/management.

chmod -R 777 ./management 

4. Start weblogic and enable local jconsole for remote connection. Select "remote process" and enter the host IP address and port number.

Click "Connect" to display the monitoring page:

Note: When weblogic is started and disabled, the setDomainEnv. sh script is called. If weblogic is configured and disabled after weblogic is started, a message indicating that the port number is in use is displayed. This problem occurs because the listening program for the port number is started when weblogic is started and disabled. You can add a judgment in setDomainEnv. sh to start listening to the port number only when weblogic is started.

3. remote connection to redhat + tomcat

1. In the same step as in the previous section, the difference is that when tomcat is started and the parameter file is set to catalina. sh, the parameter must be set here.

JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=192.168.1.110""JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9000"JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

2. for redhat, by default, hostname does not correspond to an ip address. You can use hostname-I to view the redhat. If 127.0.0.1 is displayed, You need to configure/etc/hosts.

#127.0.0.1              localhost.localdomain localhost192.168.1.110           localhost.localdomain localhost

Note: comment the line 127.0.0.1, and then map the hostname to 192.168.1.110.

3. Configure the files in the $ {JAVA_HOME}/jre/lib/management directory.

cp jmxremote.password.template jmxremote.password

Restore the commented out content:

monitorRole  QEDcontrolRole   R&D

Run the following command to modify the file attributes:

chmod 600 jmxremote.accesschmod 600 jmxremote.password

4. See Step 4 in the previous section.

Note: The catalina. sh script is called when tomcat is started and disabled. If the configuration is complete and tomcat is started, and tomcat is disabled again, a message indicating that the port number is in use is displayed. This problem occurs because the listener for this port number is started when tomcat is started and disabled. It can be considered that listening to the port number is started only when the start parameter is determined when tomcat is started.

Through the above configuration, we can see that the configurations on the sunos system and redhat system are inconsistent, and the configurations in tomcat are also inconsistent. Pay attention to the differences.

Iv. Verification and Exception Handling

1. After the instance is started, the system starts listening to the configured port. You can run the following command to check whether the instance is started properly:

netstat -an | grep 9000

If there is a listener, it indicates that the instance is started normally.

2. After jconsole is started, the system prompts that the connection fails, but the port has been connected to the remote host (you can view it through netstat-).
Check whether the configuration is correct or whether the firewall is disabled.

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.