I'm trying to install New Relic on an Ubuntu 14.04 server, to monitor a Confluence installation on the same server. When I try and run the installer, I get:
***** ( ( o)) New Relic Java Agent Installer
***** Installing version 3.22.0 ...
* Could not edit start script because:
Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /srv/data-confluence
* 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: /srv/data-confluence/newrelic/newrelic.yml
***** Install incomplete
I tried to manually install it by following the information here: https://docs.newrelic.com/docs/agents/java-agent/installation/java-agent-manual-installation and running the command for Tomcat, still no joy - same error.
For those who run into this same issue:
Wrap up
Historical note: This is Confluence running an instance of Tomcat 8.
Luca attempted to install using the New Relic Agent self-installer. Running java -jar newrelic.jar install within the /newrelic/ folder located in the Confluence home folder (in this case/srv/atlassian-confluence/bin/) successfully added the -javaagent switch to the catalina.sh, but then output into the console
***** Installing version 3.22.0 ...
Could not edit start script because:
Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /srv/data-confluence
Try re-running the install command with the -s option or from /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: /srv/atlassian-confluence/newrelic/newrelic.yml
***** Install incomplete
At this point, Luca moved the newrelic.jar and newrelic.yml from /srv/atlassian-confluence/bin/newrelic to the folder above, namely /srv/atlassian-confluence/bin/. The new relic agent attempted to start up with confluence after running the startup-confluence.sh startup script but was (1) unable to create a log file, and (2) caused confluence to throw an exception.
In order to remedy this situation, Luca and I needed to:
(1) Remove the multi-line switch added by new relic to catalina.sh
(2) Run through the java agent manual installation instructions but instead of putting export JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/newrelic.jar" into catalina.sh we put it into the confluence startup script startup-confluence.sh.
At this point, Luca needed to run the stop and start scripts for Confluence to get the agent reporting to the New Relic APM dashboard.
The confusion herein was that the auto-installer didn't work, so the auto-installer's changes needed to be reversed and the JAVA_OPTS environment variable set within the appropriate script.
Related
I have installed apache tomcat7 using sudo apt get in ubuntu. I have added apache tomcat 7 to eclipse using Windows > Preferences > Server > Runtime Environment.But when I'm starting the server from server view by right clicking the shown Tomcat v7.0 Server at localhost [Stopped,Republish]
It says:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0
Server at localhost-config. The configuration may be corrupt or
incomplete.
The path to tomcat7 that I've provided is /usr/share/tomcat7
I've just been encountering a very similar issue in Ubuntu while trying to get Eclipse Mars and Tomcat7 integrated because Eclipse was expecting the tomcat configuration files etc to be all in the same location, and with the necessary permissions to be able to change those files.
The following instructions from this blog article helped me in the end:
cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /var/log/tomcat7 log
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo chmod -R a+rwx /usr/share/tomcat7/conf
I've just solved this exact problem on my Ubuntu 14.04 with Eclipse Mars 2.
This could happen when Eclipse is not finding Tomcat's configuration files where they are expected to be. This place is in
$eclipse_workspace_folder/$version_of_your_tomcat_server_at_localhost/
(by default if you didn't changed server's name). So you have to copy all the files under your $tomcat_installation_folder/conf/* to the workspace server's folder.
But it was easier to just remove the server from your server list and add it again. Eclipse will automatically recreate all these files again into the proper folders. Like in the picture below:
In my case I've downloaded tomcat-8.0.35 from the website, so the configuration files needed are in /opt/apache-tomcat-8.0.35/conf/ filesystem.
Just delete the desired server from the Servers view (Window -> Show View -> Servers) and then go to Window -> Preferences -> Server -> Runtime Environment -> Add and add the server again.
You can install tomcat7 in ~/tomcat7 instead of /usr/share/tomcat7.
Close Eclipse.
Delete org.eclipse.wst.server.core.prefs and org.eclipse.jst.server.tomcat.core.prefs in {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings.
Launch Eclipse.
Go to Window->Show View->Other... and choose the Servers.
Select Tomcat v7.0 Server from the server type and press Next.
Enter /home/user/tomcat7 (not /usr/share/tomcat7) into the "Tomcat installation directory" and press Download.
Wait a few minutes and press Finish.
tomcat7 worked correctly with Eclipse 4.4 on my Ubuntu 15.04 in this way.
I know it's an old question and it has been solved already but for me the Tomcat conf/tomcat-users.xml file was created with a different encoding from the rest of the configuration files. The first line of that file looked like this:
<?xml version='1.0' encoding='cp65001'?>
All I had to do to solve the issue was change that line for:
<?xml version="1.0" encoding="UTF-8"?>
And voila.
I have no idea what 'cp65001' means or why it was created like that.
Maybe this will help other users facing the same issue.
The application is trying to load /usr/share/tomcat7/conf/ which doesn't exist. Eclipse assumes conf is in the same directory as bin
In Ubuntu, conf is placed in /etc/tomcat7/ and there is a symbolic link in /var/lib/tomcat7/.
To solve this, you can either
Download package from Apache Tomcat, and place them in a specific directory, say /opt/ or
Create a symbolic link in /usr/share/tomcat7/ pointing to /etc/tomcat7/conf
A quick solution in eclipse to resolve when Tomcat could not load as per the following error:
Just refresh the Tomcat folder should do the trick. If it still does not work, delete all files in eclipse under the Tomcat folder, re-copy the server files then refresh the Tomcat folder. Tomcat should restart correctly after that.
I have Windows 8.1, Eclipse Neon, Tomcat 8.
The solution is to copy all the files from folder ".../Tomcatxxx/conf" to the ".../Workspace_directory/Servers" and try to launch server again.
You tried to start Tomcat and got the following error:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete
How to solve:
Close Eclipse
Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0 Server at localhost-config
Start Eclipse
Expand the Servers project, click on the Tomcat 7 project and hit F5
Start Tomcat from Eclipse
I know it's been a while since this question was posted, but I was just getting this exact error, and I have a really simple solution that MIGHT work for some. All I did was double click on the folder 'Servers', which then allowed me to start the server with no error message. Sometimes the solution is right in front of your eyes. This might work for some people like me who go straight to google without trying fix the issue themselves!
on Centos 7, this will do it, for Tomcat 7 :
(my tomcat install dir: opt/apache-tomcat-7.0.79)
mkdir /var/lib/tomcat7
cd /var/lib/tomcat7
sudo ln -s /opt/apache-tomcat-7.0.79/conf conf
mkdir /var/log/tomcat7
cd /var/log/tomcat7
sudo ln -s /opt/apache-tomcat-7.0.79/logs log
not sure the log link is necessary, the configuration is the critical one.
:
Had the same issue with Kepler (after trying to add a Tomcat 7 server).
Whilst adding the server I opted to install the Tomcat binary using the download/install feature inside Eclipse. I added the server without adding any apps. After the install I tried adding an app and got the error.
I immediately deleted the Tomcat 7 server from Eclipse then repeated the same steps to add Tomcat 7 back in (obviously skipping the download/install step as the binary was downloaded first time around).
After adding Tomcat 7 a second time I tried adding / publishing an app and it worked fine. Didn't bother with any further RCA, it started working and that was good enough for me.
I had the same problem in Eclipse Oxygen with Tomcat 8 in ubuntu 16.04 LTS.
Solution:
1. Give permission to entire tomcat folder (chmod 777 -R /Tomcat)
2. Delete and re-add the server in eclipse
3. Restart eclipse
4. Start the tomcat server. It will work..........
In the Servers tab of eclipse, go to the properties of the server and Switch location to latest downloaded tomcat version.
This resolved the issue for me.
Tomcat Server Properties
I solved this problem. DON'T USE THE .exe
Unistall Tomcat and download the .zip from Tomcat's web site. Then unpack and put it in C:\Program Files. Open Eclipse and set the server. it will work.
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)
Per the installation directions I run:
./bin/sqoop.sh client
and it returns error:
could not find or load main class org.apache.sqoop.shell.SqoopShell
I'm setting up Sqoop for the first time. I have the server up and running on Redhat Linux. Now I am stuck running the client on Windows Server 2012. I am running hadoop v2 and sqoop-1.99.3-bin-hadoop200. At the command line I verified java is installed by running "java -version" at the command line and seeing "1.8.0". Scoop is written in Java 1.6. Does that matter? I'm having difficulty locating an active download link to 1.6 for windows for troubleshooting.
I tried installing Cygwin and running the command. Same error.
Locate the directory traversal for the case of client in sqoop.sh
# Build class path with full path to each library
for f in $SQOOP_CLIENT_LIB/*.jar; do
CLASSPATH="${CLASSPATH}:$f"
done
Just add the following search and replace params (note changes of colon to semicolon in classpath)
# Build class path with full path to each library
PARAMSEARCH="/c/"
PARAMREPLACE="C:\\"
for f in $SQOOP_CLIENT_LIB/*.jar; do
f=${f/$PARAMSEARCH/$PARAMREPLACE}
CLASSPATH="${CLASSPATH};$f"
done
I had the same issue running on Windows 8.1. Turns out it's caused because sqoop.sh uses POSIX style directory paths. So / instead of . This results in the script being unable to set the correct CLASSPATH. This could have been remedied by using a cmd file for Windows. I don't know why they didn't do it. There are cmd files for catalina and such but not for launching sqoop!
Anyway I got around this issue by adding all the jar files in the shell\lib folder to CLASSPATH. You do have to add each & every jar file there and not just the folder path. A restart was required after this which was annoying. However the shell script will still not launch the client even after this change. The little trick I used is to just launch the client at the command prompt from the shell\lib folder with the following command
***java org.apache.sqoop.shell.SqoopShell***
Now I get the groovy prompt from where I can run all the commands provided here
I used the following steps to configure sqoop in a windows machine and now able to work with sqoop 1.99.3 successfully.
*Cygwin must be installed before continuing further steps. Also its just for using the native libraries, we can interact with sqoop directly from windows command prompt.
Save the sqoop package folder in “C:” drive name as sqoop
Copy the hadoop lib folder “hadoop” from C:\hadoop\share into C:\usr\lib\hadoop [If this directory doesn't exists, then create one]
Change the hadoop configuration properties in the file “sqoop.properties” from the location “C:\sqoop\server\conf” as below
at line:132
org.apache.sqoop.submission.engine.mapreduce.configuration.directory=C:\hadoop\etc\hadoop
Copy the sqoop.properties and sqoop_bootstrap.properties from “C:\sqoop\server\conf” into “C:\sqoop\server\bin”.
Set the environment variables for sqoop home as well as path:
SQOOP_HOME = C:\sqoop
Starting the server:
Open Command prompt (run as Administrator) and enter into the $SQOOP_HOME location and type command as follows
C:\sqoop> cd server\bin
C:\sqoop\server\bin> catalina start
The catalina server will be start and check it in the below location
http://localhost:12000/sqoop
Client Shell Command
Open the command prompt and enter the following command
java -classpath C:\sqoop\shell\lib\sqoop-shell-2.0.0-SNAPSHOT.jar;C:\sqoop\shell\lib\sqoop-common-2.0.0-SNAPSHOT.jar;C:\sqoop\shell\lib\sqoop-client-2.0.0-SNAPSHOT.jar;C:\sqoop\shell\lib\log4j-1.2.16.jar;C:\sqoop\shell\lib\json-simple-1.1.jar;C:\sqoop\shell\lib\jline-0.9.94.jar;C:\sqoop\shell\lib\jersey-core-1.11.jar;C:\sqoop\shell\lib\jersey-client-1.11.jar;C:\sqoop\shell\lib\jansi-1.7.jar;C:\sqoop\shell\lib\hamcrest-core-1.3.jar;C:\sqoop\shell\lib\groovy-all-1.8.5.jar;C:\sqoop\shell\lib\commons-lang-2.6.jar;C:\sqoop\shell\lib\commons-cli-1.2.jar org.apache.sqoop.shell.SqoopShell
The client shell command will be displayed as :
Sqoop Shell: Type 'help' or '\h' for help.
sqoop:000>
Hope this helps
Thanks
Here is what I want to do. --> Deploy a play framework (2.2.1) Java web application on Heroku and use newrelic as an add on.
**Issue /problem:**
These are the steps i did so far.
1) I am able to add addon using the heroku command of addon "heroku addons:add newrelic:stark" I see the add on in the heroku resources.
2) Adding the newrelic.yml file. added the newrelic.yml file as attached and saved in the conf folder of the play framework (were the application.conf file is present). The file I picked up is from https://gist.github.com/anfuerer/6169040 (just updated licence and app info)
3) As its play 2.2.1, changed the built.sbt file to add dependencies.
"com.newrelic.agent.java" % "newrelic-agent" % "3.4.0",
"com.newrelic.agent.java" % "newrelic-api" % "3.4.0"
4) My Procfile which is required for heroku has the JAVA_OPTS specified and the JAVA_OPTS is set by using the command
heroku config:set JAVA_OPTS=”-Xmx384m -Xss512k -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -javaagent:target/staged/newrelic-agent-3.4.0.jar -Dnewrelic.bootstrap_classpath=true -Dnewrelic.config.file=./conf/newrelic.yml newrelic.config.log_level=finer newrelic.debug=true”
5) obviously all the changes are added to git and committed before pushing to heroku by command "git heroku push master".
6) some basic sanity test.. I see my config after heroku config command as -
JAVA_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -javaagent:target/staged/newrelic-agent-3.4.0.jar -Dnewrelic.bootstrap_classpath=true -Dnewrelic.config.file=./conf/newrelic.yml newrelic.config.log_level=finer newrelic.debug=true
NEW_RELIC_APP_NAME: test_application
NEW_RELIC_LICENSE_KEY: 000000000000000000000000000000000 (changed offcourse)
NEW_RELIC_LOG: stdout
PATH: .jdk/bin:.sbt_home/bin:/usr/local/bin:/usr/bin:/bin
REPO: /app/.sbt_home/.ivy2/cache
SBT_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops
Also tried to check by "heroku run env | grep NEW_RELIC" which gives me output -
NEW_RELIC_LOG=stdout
NEW_RELIC_LICENSE_KEY=00000000000000000000000000000
NEW_RELIC_APP_NAME=test_application
Now I go to my Heroku app dashboard, click on my app to see the add ons and click on new relic and i come to a screen which asks me to setup my app-
I click on setup, but which takes me to download the Java agent and it want me to install the java agent on to the webserver.
#################EDIT
Trying to install java newrelic on Play app framework as per #Jeanie's comment
1) download the new relic java agent in downloads folder.
2) unzip to the play framework app folder(project folder) (does this need to be the play framework folder where play build files are??) using
unzip newrelic_agent3.4.0.zip -d /path/to/appserver/
3) change directory to /appfolder/newrelic/
4) install the jars using
java -jar newrelic.jar install
5) This is the message I am getting.
Jan 20, 2014 12:48:39 -0700 [6935 1] com.newrelic INFO: Agent is using Logback
***** ( ( o)) New Relic Java Agent Installer
***** Installing version 3.4.0 ...
Could not edit start script because:
.:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /home/amit/Applications/play-2.2.1/appfolder/
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: /home/amit/Applications/play-2.2.1/appfolder/newrelic/newrelic.yml
***** Install incomplete
***** Next steps:
For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java
Am I missing something here? Please note this is a Play framework app and I want newrelic addon to work on heroku and not locally on my machine.
#
Questions:
1) How do I install the java agent on heroku?? Do I need to in the first place?
2) Shouldn't heroku and new relic add on pick up my app as I have already added the api and java agent as a add on as step 3 ??
Any help or direction appreciated.
Issue resolved. Here are the steps.
1) Get the add on on Heroku by
$ heroku addons:add newrelic:stark
2) Go to your app dashboard and click on resources. Then click on the new relic addon. This will take you to a page where it will ask you to do a set up.
3) Click on set up, select Java, click to see your licence number and download the jar files.
4) As mentioned on the set up page unzip the jars files to the root of your project. Don't run the installer as you need the new relic working on Heroku.
5) Edit the Heroku Procfile as below:
web: target/universal/stage/bin/myapp -Dhttp.port=${PORT} ${java_opts} -DapplyEvolutions.default=true -Ddb.default.driver=com.mysql.jdbc.Driver -Ddb.default.url=${CLEARDB_DATABASE_URL} -J-javaagent:newrelic/newrelic.jar -J-Dnewrelic.config.file=newrelic/newrelic.yml
(change the other settings as per your need, keep the new relic settings unchanged, dont forget to put your app name in place of myapp in "target/universal/stage/bin/myapp")
6) Add dependency to either build.sbt or Build.scala
"com.newrelic.agent.java" % "newrelic-agent" % "3.7.0"
7) Deploy the app to heroku using git push heroku master
8) New relic will be automatically detected and the setup page will show the relevant metrics.
If anyone face any issues, let me know.
Just to get it out of the way so that we're not asking you the same basic questions. Did you go off the instructions at https://devcenter.heroku.com/articles/newrelic and pay close attention to the Java configuration at https://devcenter.heroku.com/articles/newrelic#java-configuration? That should get you going in the right direction.
Let us know if this does the trick or if you need further help. There is a ticket associated with this that we can continue to troubleshoot further, if needed.
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?
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!
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
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.
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
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.
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.