adding newrelic addon heroku java

吃可爱长大的小学妹 提交于 2019-12-13 05:47:24

问题


I'm trying to add the newrelic addon to my application that is deployed in heroku using Jetty. This is what i'm trying to do and the answer I get. I Already unpack the newrelic folder in the root.

~ $ java -jar newrelic/newrelic.jar install
Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true -Djava.rmi.server.useCodebaseOnly=true
Jul 16, 2014 03:20:57 +0000 [95 1] com.newrelic INFO: Agent is using Logback    
***** ( ( o))  New Relic Java Agent Installer
***** Installing version 3.8.1 ...
Could not edit start script because:
 .:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /app
Try re-running the install command with the -s <AppServerRootDirectory> option or from <AppServerRootDirectory>/newrelic.
If that doesn't work, locate and edit the start script manually.
No need to create New Relic configuration file because:
 .:. A config file already exists: /app/newrelic/newrelic.yml
***** Install incomplete
***** Next steps:
For help completing the install,

thank you for the help


回答1:


What is in /app? Is that where your dispatcher (e.g. Tomcat, Jetty, JBoss, Glassfish, etc.) is located? If your dispatcher is not in /app you should move the newrelic directory to the same directory as your dispatcher. As an alternative, you could edit the startup script (catalina.sh, for example) for the dispatcher and provide the fully qualified path to the newrelic.jar. The error message is telling you that the installer attempted to edit the startup script for the dispatcher (see below) and could not find it. If you were using Tomcat, say, then the installer would want to find a catalina.sh file and add a couple of lines to that file. The installer looked in the parent of newrelic (i.e. /app) and didn't find a bin directory which it would have if Tomcat were a child of /app.

Example 1:

Tomcat is in /var/opt/tomcat and you want to put newrelic in the same directory. If you then took the newrelic directory and made its path /var/opt/tomcat/newrelic then your command java java -jar newrelic/newrelic.jar install will work because the installer will look in /var/opt/tomcat/bin and see the catalina.sh file which it will edit to put a pointer to the newrelic.jar file.

Example 2:

Tomcat is in /var/opt/tomcat and you do not want newrelic to be a child of tomcat and instead want it to live in /app/newrelic. In that case you would edit the catalina.sh file and add the following two lines:

NR_JAR=/app/newrelic/newrelic.jar; export NR_JAR
JAVA_OPTS="$JAVA_OPTS -javaagent:$NR_JAR"; export JAVA_OPTS

Please let me know if you need clarification on any of the above.

Cheers Adrienne

(New Relic Support)



来源:https://stackoverflow.com/questions/24771713/adding-newrelic-addon-heroku-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!