dipendra
dipendra

Reputation: 235

Unable to install new relic on linux using tomcat server

I have created account on new relic and downloaded zip for new relic agent and uploaded to /etc directory in my linux machine(tomcat server).

As per documentations, I follow the following code

cd /etc/newrelic
java -jar newrelic.jar install

But I am getting following error:

Dec 31, 2013 06:14:04 +0000 NewRelic 1 INFO: Agent is using Logback
***** ( ( o))  New Relic Java Agent Installer
***** Installing version 3.2.3 ...
Could not edit start script because:
 .:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /etc
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: /etc/newrelic/newrelic.yml
***** Install incomplete
***** Next steps:
For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java

Can anyone give me solution for this?

Upvotes: 4

Views: 4555

Answers (6)

qr&#228;bn&#246;
qr&#228;bn&#246;

Reputation: 3031

The folder newrelic belongs to /usr/share/tomcat/. At least on Ubuntu 16.04 with Tomcat 7. Then also the install command works. Please do not forget to read and adapt the whole newrelic.yml file.

Upvotes: 0

user8274173
user8274173

Reputation: 1

Before you do any of these steps, make sure that your new relic folder is in inside the folder of your server. That immediately fixed my problem.

Upvotes: 0

Rene Enriquez
Rene Enriquez

Reputation: 1599

I was dealing with the same error, you only need to copy the new-relic.jar file inside the root of your tomcat server and then type:

java -jar new-relic.jar install

And that's it, it worked for me. Hope it helps

Upvotes: 1

sarthak chatterjee
sarthak chatterjee

Reputation: 1

Before installing the New Relic the code will fetch the requisite environment parameters like JAVA_HOME, TOMCAT_HOME, etc ( depends on your configuration) and then install the agent on your server. Make sure all the required env variables are defined.

After you have done the above, also check the following: a) The New Relic should be extraced/installed in your home directory ( in my case /APP)

cd /APP

Unzip newrelic-java-3.26.1.zip –d /APP

b) The Java agent should be defined in the local properties file ( I have configured it for Hybris server in Dev environment)

vim /APP/hybris/config/local.properties

Add : -javaagent:/APP/newrelic/newrelic.jar –D newrelic.environment=Development

c) In some cases, it requirs the application specific yml file along with the newrelic.yml file ( in my case hybris.yml)

Cd /APP/newrelic

mkdir extensions

chmod 755 extensions

cd /APP/newrelic/extensions

vim hybris.yml

Hybris specific configuration for the hybris.yml file ( use jmx.yml)

Add the jmx.yml data in the hybris.yml after creating the file.

d) Restart your application: I did it using the following commands:

cd /APP/hybris/bin/platform

ant clean all

e) You should see the data in sometime. Keep monitoring the new relic logs in:

tail -f /APP/newrelic/logs/newrelic_agent.log

Upvotes: 0

Hollie at New Relic
Hollie at New Relic

Reputation: 1

I work in support at New Relic, specializing in the Java agent.

Since Tomcat installations vary between Linux environments, your best bet is to follow the manual installation instructions:

https://docs.newrelic.com/docs/java/java-agent-manual-installation

Scroll down to the Tomcat instructions, which advise you to add the -javaagent flag to your Tomcat startup script. Once you've made that change and started your Tomcat instance, you can verify that the newrelic.jar is included in the startup arguments by issuing a ps -ef | grep java command.

If you need further help, please open a support ticket at support.newrelic.com and we'll be glad to assist.

Upvotes: 0

Rugal
Rugal

Reputation: 2717

As the log information provide that it Could not locate a Tomcat, you need to provide env var like TOMCAT_HOME and so on.
In linux, even if you have installed some software, it can not be conveniently used without adding into PATH or some other env var.
In your situation, seems you need to add TOMCAT_HOME and export it.
Make sure the tomcat is correctly installed!

Upvotes: 1

Related Questions