添加newrelic插件heroku java [英] adding newrelic addon heroku java

查看:259
本文介绍了添加newrelic插件heroku java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将newrelic插件添加到使用Jetty部署在heroku中的应用程序中。
这就是我想要做的和我得到的答案。我已经在根目录下解压newrelic文件夹。

 〜$ java -jar newrelic / newrelic.jar install 
Picked向上JAVA_TOOL_OPTIONS:-Djava.rmi.server.useCodebaseOnly =真-Djava.rmi.server.useCodebaseOnly =真
2014年7月16日三时20分57秒0000 [95 1] com.newrelic INFO:代理是使用Logback
*****((o))新的Relic Java代理安装程序
*****安装版本3.8.1 ...
无法编辑启动脚本,因为:
。:。找不到/ app $ b $中的Tomcat,Jetty,JBoss,JBoss7或Glassfish实例尝试使用-s< AppServerRootDirectory>命令重新运行install命令。选项或来自< AppServerRootDirectory> / newrelic。
如果这不起作用,请手动找到并编辑启动脚本。
不需要创建New Relic配置文件,因为:
。:。配置文件已存在:/app/newrelic/newrelic.yml
*****安装不完整的
*****后续步骤:
如需帮助完成安装,

感谢您的帮助

解决方案

什么是/ app?这是您的调度员(例如Tomcat,Jetty,JBoss,Glassfish等)的位置吗?如果您的调度程序在/ app中不是,则应将newrelic目录移动到与调度程序相同的目录中。或者,您可以编辑调度程序的启动脚本(例如catalina.sh),并提供newrelic.jar的完全限定路径。该错误消息告诉你,安装程序试图编辑调度程序的启动脚本(见下文),并找不到它。比方说,如果你使用的是Tomcat,那么安装程序会希望找到一个catalina.sh文件并在该文件中添加几行。安装程序在newrelic(ie / app)的父目录中查找,并且没有找到一个bin目录,如果Tomcat是/ app的子目录,它将具有该目录。

示例1:

Tomcat位于/ var / opt / tomcat 中,希望将newrelic放在同一个目录中。如果你接着使用newrelic目录并创建路径/ var / opt / tomcat / newrelic,那么你的命令java java -jar newrelic / newrelic.jar安装将会工作,因为安装程序将在/ var / opt / tomcat / bin中查找并查看它将编辑的catalina.sh文件将指针指向newrelic.jar文件。



示例2:



Tomcat在/ var / opt / tomcat 不希望 newrelic成为tomcat的子项,而是希望它位于/ app / newrelic中。在这种情况下,您将编辑catalina.sh文件并添加以下两行:

  NR_JAR = / app / newrelic / newrelic 。罐;导出NR_JAR 
JAVA_OPTS =$ JAVA_OPTS -javaagent:$ NR_JAR; export JAVA_OPTS

如果您需要澄清上述任何内容,请让我知道。

欢呼
Adrienne



(新圣物支持)

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

解决方案

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)

这篇关于添加newrelic插件heroku java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆