This topic describes how to install the CloudMonitor agent for Java on an Elastic Compute Service (ECS) instance.

Important The CloudMonitor agent for Java is no longer upgraded. We recommend that you use the CloudMonitor agent for C++. For more information, see Install and uninstall the CloudMonitor agent for C++.

Install the CloudMonitor agent for Java in Linux

Common commands

# View the status of the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh status

# Start the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh start

# Stop the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop

# Restart the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh restart

# Uninstall the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove && \
rm -rf /usr/local/cloudmonitor

Installation command

Run the region-specific installation command on the ECS instance as the root user.
  • China (Qingdao) (region ID: cn-qingdao)
    REGION_ID=cn-qingdao VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Beijing) (region ID: cn-beijing)
    REGION_ID=cn-beijing VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Zhangjiakou) (region ID: cn-zhangjiakou)
    REGION_ID=cn-zhangjiakou VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hohhot) (region ID: cn-huhehaote)
    REGION_ID=cn-huhehaote VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hangzhou) (region ID: cn-hangzhou)
    REGION_ID=cn-hangzhou VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Shanghai) (region ID: cn-shanghai)
    REGION_ID=cn-shanghai VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Shenzhen) (region ID: cn-shenzhen)
    REGION_ID=cn-shenzhen VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hong Kong) (region ID: cn-hongkong)
    REGION_ID=cn-hongkong VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • US (Silicon Valley) (region ID: us-west-1)
    REGION_ID=us-west-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-us-west-1.oss-us-west-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • US (Virginia) (region ID: us-east-1)
    REGION_ID=us-east-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-us-east-1.oss-us-east-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Singapore (region ID: ap-southeast-1)
    REGION_ID=ap-southeast-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Australia (Sydney) (region ID: ap-southeast-2)
    REGION_ID=ap-southeast-2 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-2.oss-ap-southeast-2-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Malaysia (Kuala Lumpur) (region ID: ap-southeast-3)
    REGION_ID=ap-southeast-3 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Indonesia (Jakarta) (region ID: ap-southeast-5)
    REGION_ID=ap-southeast-5 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Japan (Tokyo) (region ID: ap-northeast-1)
    REGION_ID=ap-northeast-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • India (Mumbai) (region ID: ap-south-1)
    REGION_ID=ap-south-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-south-1.oss-ap-south-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Germany (Frankfurt) (region ID: eu-central-1)
    REGION_ID=eu-central-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • UK (London) (region ID: eu-west-1)
    REGION_ID=eu-west-1 VERSION=1.3.7 \ bash -c "$(curl https://cms-agent-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • UAE (Dubai) (region ID: me-east-1)
    REGION_ID=me-east-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-me-east-1.oss-me-east-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"

Install the CloudMonitor agent for Java in Windows

  1. Download the agent installation package of the 64-bit version or 32-bit version based on the operating system type of the ECS instance.
  2. Create a directory named cloudmonitor in the C:\Program Files\Alibaba directory.
  3. Decompress the agent installation package to the C:\Program Files\Alibaba\cloudmonitor directory.
  4. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\InstallApp-NT.bat file as an administrator to install the agent.
  5. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\StartApp-NT.bat file as an administrator to start the agent.
  6. After you install the agent, view, start, or stop the Cloud Monitor Application service in Windows Services Manager.

Uninstall the CloudMonitor agent for Java in Windows

  1. Stop the Cloud Monitor Application service in Windows Services Manager.
  2. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\UninstallApp-NT.bat file to uninstall the agent.
  3. Delete the C:\Program Files\Alibaba\cloudmonitor directory.

Security configuration instructions

The following table describes the IP addresses and ports that the CloudMonitor agent uses to interact with CloudMonitor servers. If the ports are disabled by security software, the CloudMonitor agent fails to report monitoring data to CloudMonitor. If you use a whitelist to limit the IP addresses that your ECS instance can access, we recommend that you add the IP addresses described in the following table to the whitelist.

Note CloudMonitor may change the IP addresses that it uses to provide services in the future versions. However, all the IP addresses will reside in the 100.100 CIDR block, which is the reserved internal CIDR block that Alibaba Cloud uses to provide services. Therefore, you can allow outbound traffic to the 100.100 CIDR block for your ECS instance. This simplifies the whitelist configuration.
RegionIP addressDirectionDescription
China (Hangzhou) (region ID: cn-hangzhou) 100.100.19.43:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.45.73:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Beijing) (region ID: cn-beijing)100.100.18.22:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.18.50:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Qingdao) (region ID: cn-qingdao)100.100.36.102:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.15.23:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Shenzhen) (region ID: cn-shenzhen)100.100.0.13:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.0.31:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Hong Kong) (region ID: cn-hongkong)100.103.0.47:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.103.0.45:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Hohhot) (region ID: cn-huhehaote)100.100.80.135:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.12:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Zhangjiakou) (region ID: cn-zhangjiakou)100.100.80.92:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.0.19:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Shanghai) (region ID: cn-shanghai)100.100.36.11:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.36.6:80OutboundUsed to collect monitoring data to CloudMonitor.
China (Chengdu) (region ID: cn-chengdu)100.100.80.229:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.14:80OutboundUsed to collect monitoring data to CloudMonitor.
US (Virginia) (region ID: us-east-1)100.103.0.95:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.103.0.94:80OutboundUsed to collect monitoring data to CloudMonitor.
US (Silicon Valley) (region ID: us-west-1)100.103.0.95:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.29.7:80OutboundUsed to collect monitoring data to CloudMonitor.
Germany (Frankfurt) (region ID: eu-central-1)100.100.80.241:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.72:80OutboundUsed to collect monitoring data to CloudMonitor.
UK (London) (region ID: eu-west-1)100.100.0.3:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.0.2:80OutboundUsed to collect monitoring data to CloudMonitor.
Singapore (region ID: ap-southeast-1)100.100.30.20:3128OutboundUsed for control operations, such as management of monitoring configurations.
100.100.103.7:80OutboundUsed to collect monitoring data to CloudMonitor.
Australia (Sydney) (region ID: ap-southeast-2)100.100.80.92:8080OutboundUsed for control operations, such as management of monitoring configurations.

100.100.80.13:80

[47.91.39.6:443]

OutboundUsed to collect monitoring data to CloudMonitor.
Malaysia (Kuala Lumpur) (region ID: ap-southeast-3)100.100.80.153:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.140:80OutboundUsed to collect monitoring data to CloudMonitor.
Indonesia (Jakarta) (region ID: ap-southeast-5)100.100.80.160:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.180:80OutboundUsed to collect monitoring data to CloudMonitor.
UAE (Dubai) (region ID: me-east-1)100.100.80.142:8080OutboundUsed for control operations, such as management of monitoring configurations.

100.100.80.151:80

[47.91.99.5:443]

OutboundUsed to collect monitoring data to CloudMonitor.
Japan (Tokyo) (region ID: ap-northeast-1)100.100.80.184:8080OutboundUsed for control operations, such as management of monitoring configurations.

100.100.80.137:80

[47.91.8.7:443]

OutboundUsed to collect monitoring data to CloudMonitor.
India (Mumbai) (region ID: ap-south-1)100.100.80.152:8080OutboundUsed for control operations, such as management of monitoring configurations.
100.100.80.66:80OutboundUsed to collect monitoring data to CloudMonitor.

Resource usage

  • Installation package size: 75 MB.
  • Disk space occupied after installation: 200 MB.
  • Memory usage: 64 MB.
  • CPU utilization: less than 1%.
  • Network: internal network. No Internet bandwidth is used.

Usage notes

  • The CloudMonitor agent stores monitoring logs in the following directories:
    • Linux: /usr/local/cloudmonitor/logs
    • Windows: C:\Program Files\Alibaba\cloudmonitor\logs
  • If the port used by the CloudMonitor agent conflicts with the port used by your business application, you can change the port range in the /usr/local/cloudmonitor/wrapper/conf/wrapper.conf configuration file and restart the CloudMonitor agent.
    wrapper.port.min=40000
    wrapper.port.max=41000
    wrapper.jvm.port.min=41001
    wrapper.jvm.port.max=42000