Jprofile experience-Windows

Source: Internet
Author: User

Jprofile is a famous javaProgramMonitoring Tool. If you are not clear about its specific role, visit its official website. I will not introduce its functions here. I just want to talk about some of its experiences.

It is not difficult to use jprofile to monitor common Java applications. In its wizard, the configuration is described step by step, and the created session is opened. It is easy to click Start.
However, if you want to monitor the local server or perform remote monitoring, the situation will be more complicated. To achieve remote monitoring, jprofile must be installed on both the monitoring end and the monitored end.

 

Jprofile monitoring end Configuration:
In the jprofile of the monitoring end, the setting does not change much. You just need to select more options according to the wizard.

 

Remote Configuration of the monitored end:

(1) Add the following startup parameters to "Java runtime Parameters" of the Java application.
-Xrunjprofiler: Port = 8849-xbootclasspath/A: e:/progra ~ 1/jprofi ~ 1/bin/agent. Jar

Simply put, the above parameters are added to the command line used to start the Java application.
Port = 8849. This port is the remote port set for listening in jprofile. It must be consistent with the setting in jprofile. In addition, the agent. jar file should be located in the bin directory of the jprofile installation directory (corresponding to the monitored path ). If the directory is too long or contains spaces, be sure to convert it to an 8-bit length format. Otherwise, the path may not be found (this problem occurs in Windows ).

(2) Add bin \ windows in the jprofile installation path to the PATH environment variable.
E: \ Program Files \ jprofiler5 \ bin \ WINDOWS

Note: This path should be bin \ windows under the jprofile installation path (different directories are not used for different systems, but for UNIX and Linux. Bin \ Unix or bin \ Linux. These two versions have never been used)

After the configuration is complete, you can start the monitored Java application and jprofile, And then you can see the monitoring data on jprofile. This is the general process of using jprofile for monitoring. There is no difference in the configuration steps of different usage modes.

 

Several monitoring modes of jprofile

Jprofile provides three monitoring modes:Waiting Mode,Non-Wait Mode,Offline mode.

Waiting Mode: In the waiting mode, the monitored Java application needs to wait for the jprofile connection to continue the startup process. Otherwise, the startup process will be suspended and is in the waiting for the jprofile connection.
The method to use this mode is to select this mode when jprofile configures the session, and then add:
-Xrunjprofiler: Port = 8849-xbootclasspath/A: e:/progra ~ 1/jprofi ~ 1/bin/agent. Jar

Non-Wait Mode: The monitored Java application will not be started directly after jprofile connection, and jprofile will be started as needed.
The method to use this mode is to select this mode when jprofile configures the session, and then add:
-Xrunjprofiler: Port = 8849,Nowait, id = 116, Config = E:/docume ~ 1/admini ~ 1/jprofi ~ 1/config. xml-Xbootclasspath/A: e:/progra ~ 1/jprofi ~ 1/bin/agent. Jar

Offline mode: The monitored Java application will not start directly after jprofile connection. At the same time, the monitoring data will be cached on the server side and be returned to jprofile when jprofile is connected.
The method to use this mode is to select this mode when jprofile configures the session, and then add:
-Xrunjprofiler:Offline, id = 116, Config = E:/docume ~ 1/admini ~ 1/jprofi ~ 1/config. xml-Xbootclasspath/A: e:/progra ~ 1/jprofi ~ 1/bin/agent. Jar

Note the following two points:Id = 116This is the ID of the monitoring session set in jprofile, andConfig = E:/docume ~ 1/admini ~ 1/jprofi ~ 1/config. xmlThe jprofile configuration file that contains the session (If your session is configured on the monitoring end, you must synchronize the configuration file on the monitoring end to the monitored end, otherwise, the monitored end will prompt an error because the specified sessionid cannot be found ). The above startup parameters should all be monitored paths.

 

Was Server Remote Monitoring settings

1. Configure jprofile to create a session for monitoring remote servers. If you select a WebSphere server in the wizard, you may need to provide the server. xml file and startserver. Bat STARTUP script file for the server. Then you go to the server, put the two files on the monitoring machine, and fill in the corresponding path. After the session is created, copy the two files back to the monitored server.
In fact, the reason why jprofile needs these two files is that it will automatically help you modify these two files, so that the was server startup environment conforms to the jprofile settings, eliminating the trouble of manual setup. If the WebSphere Single Server version you are using is fine, it is dangerous to manually modify the server's config if the network deployment version is used. In this case, my approach is to take the two files from the monitored server to the monitoring server, but do not put the files repaired back to the monitored server, instead, manually configure the was server.

2. Set was server startup parameters

Add the preceding jprofile mode parameter to the generic JVM arguments of application servers> server1> process definition> Java virtual machine.

3. Set the PATH environment variable of the machine where was is located
Add E: \ Program Files \ jprofiler5 \ bin \ windows to the path of the path to the jprofile on the monitored server)

4. Disable the Windows service corresponding to was server. If you register was server as windows. (Sometimes you can monitor the server without disabling it. If it is disabled, it cannot be started from the DM console .)

5. Synchronize the jprofile config. xml file of the monitoring end and the monitored end

6. Restart the was server. (If the startup fails in DM consol. Try to start it with a script on the command line)

7. Start jprofile and open the set session

8. Now you should see the monitoring data

 

This is some of the experiences of jprofile recently. I hope to help you. In fact, the help of jprofile is described in detail. If you have any questions, please ask.

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.