To deploy multiple instances of an application on a single host, set the -Darms.agentId parameter to a unique value for each JVM process, such as 001, 002, or 003. This parameter specifies the JVM process to connect to.
Example
# Instance 1
java -javaagent:/{user.workspace}/ArmsAgent/aliyun-java-agent.jar \
-Darms.licenseKey=<LicenseKey> \
-Darms.appName=<AppName> \
-Darms.agentId=001 \
-jar demoApp.jar
# Instance 2
java -javaagent:/{user.workspace}/ArmsAgent/aliyun-java-agent.jar \
-Darms.licenseKey=<LicenseKey> \
-Darms.appName=<AppName> \
-Darms.agentId=002 \
-jar demoApp.jarReplace the placeholders with your actual values:
| Placeholder | Description | Example |
|---|---|---|
{user.workspace} | Absolute path to the ARMS agent installation directory | /home/admin |
<LicenseKey> | ARMS license key for your application | LTAI5tXxx |
<AppName> | Application name registered in ARMS | my-order-service |
Note
The -javaagent argument must appear before the -jar argument. It is a JVM option, not an application argument.
Note
For ARMS agent versions earlier than 2.7.3.5, replace aliyun-java-agent.jar with arms-bootstrap-1.7.0-SNAPSHOT.jar. Upgrade to the latest agent version to access current features and fixes.