下载 Agent
JDK 1.6 - 1.8 请下载
wget: https://user.oneapm.com/account/5dad74ffe945c060/agent/java/OneAPM_java_Agent_latest.zip
wget:https://user.oneapm.com/account/5dad74ffe945c060/agent/java/OneAPM_java_Agent_legacy.zip
unzip OneAPM_java_Agent_latest.zip -d
<Application Server Path>/
写入「License Key」至配置文件「OneAPM/oneapm.properties」
模板如下:
注意 license_key 配置的时候不能有引号
linux /unix > bin/httpd.sh -Xms200m -Xmx1024m -Xloggc:./log/gc.log -XX:MaxNewSize=256m -XX:MaxPermSize=256m -Djava.awt.headless=true
编辑 httpd.sh, 如下内容:
args='-J-server -Xms200m -Xmx1024m -javaagent:/full/path/to/OneAPM/oneapm.jar -Xloggc:./log/gc.log -XX:MaxNewSize=256m -XX:MaxPermSize=256m -Djava.awt.headless=true'
win> bin/httpd.exe -Xmn100M -Xms500M -Xmx500M -javaagent:/full/path/to/OneAPM/oneapm.jar
install win service> bin/httpd.exe -Xmn100M -Xms500M -Xmx500M -javaagent:/full/path/to/OneAPM/oneapm.jar -install -Xss1m.
注意 -javaagent: 后面跟 oneapm.jar 安装的绝对路径。
<jvm-arg>-Xmx2048m</jvm-arg>
<jvm-arg>-Xms1024m</jvm-arg>
<jvm-arg>-javaagent:/full/path/to/OneAPM/oneapm.jar</jvm-arg>