You can use scripts to install the Application Real-Time Monitoring Service (ARMS) agent for a Java application. To monitor the application, you do not need to restart the application. We recommend that you choose this installation method if you are using ARMS for the first time. If you restart the Java application, ARMS automatically loads the ARMS agent and monitors the application.
- Make sure that the security group of your ECS instance has opened the TCP outbound
permission of ports 8442, 8443, and 8883. For more information about how to open outbound
permissions for ECS, see Add a security group rule.
Note ARMS can be connected to not only applications on ECS, but also applications on other servers that can access the Internet.
- Make sure that the third-party components or frameworks you use are within the scope of application monitoring compatibility lists. See ARMS-compatible components and frameworks .
- If you have manually installed the ARMS agent for the Java application, you must uninstall the ARMS agent before you use scripts to install the ARMS agent. For more information, see Manually install the ARMS agent for a Java application.
If the JDK Version is 1.8.0_25 or 1.8.0_31, you may fail to install the arms Agent. In this case, upgrade the JDK version to the latest version, which is 1.8.X.
- Log on to the ARMS console .
- In the left-side navigation pane, choose .
- On the Applications page, select a region in the top navigation bar, and click Add Application.
- In the Backend applications section of the Access Center panel, click Java.
- In the upper-right corner of the Access Java panel, select the region in which you want to install the Java application, and then select Script installation.
- Run the installation script in the STEP1 section.
wget -O- http://arms-apm-hangzhou.oss-cn-hangzhou.aliyuncs.com/install.sh | sh && ~/.arms/supervisor/cli.sh ****** Java-DemoNote
Java-Demowith the name of your application. The application name cannot contain Chinese characters.
- After you run the installation script, it automatically downloads the ARMS agent of the latest version.
- If your server has only one Java process, the installation script installs the ARMS agent on this process by default. If your server has multiple Java processes, select a process to install the ARMS agent.
Verify the result
After about 1 minute, if your application is displayed in the application list and specific data records are sent, your application is monitored by ARMS.
Uninstall the ARMS agent
- If you no longer want to use ARMS to monitor your Java applications, run the
jps -lcommand to view all processes and find the PID of
com.alibaba.mw.arms.apm.supervisor.daemon.Daemonin the returned results.In this example, the PID of
- Run the
kill -9 <PID>command.Example:
kill -9 62857.
- Run the
rm -rf /.arms /root/.armscommand.
- Restart your application.
How can I handle the following getcwd error when I run the installation script to install the ARMS agent?
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory Error occurred during initialization of VM java.lang.Error: Properties init: Could not determine current working directory. at java.lang.System.initProperties(Native Method) at java.lang.System.initializeSystemClass(System.java:1119)
The probable cause is that the current directory is deleted by mistake when you run the installation script. To resolve this issue, run the
cdcommand and then run the installation script again.
Where do I view logs after I run the installation script to install the ARMS agent?
The default directory of logs is /root/.arms/supervisor/logs/arms-supervisor.log. If no logs are available in this directory, run the
ps -ef |grep armscommand to view the directory where logs are stored.