0

我正在尝试将 new-relic jar 安装到我的 Openshift 应用程序(wildfly 盒式磁带),但它以permission denied. 这是日志

\> java -jar newrelic.jar install
Jan 29, 2015 15:01:14 -0500 [64858 1] com.newrelic INFO: Agent is using Logback
***** ( ( o))  New Relic Java Agent Installer
***** Installing version 3.13.0 ...
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf.20150129_150114 (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
    at com.newrelic.agent.util.EditableFile.backup(EditableFile.java:251)
    at com.newrelic.agent.install.SelfInstaller.backup(SelfInstaller.java:125)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:51)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:35)
    at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
    at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
    at com.newrelic.agent.Agent.main(Agent.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:263)
    at com.newrelic.agent.util.EditableFile.append(EditableFile.java:240)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:55)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:35)
    at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
    at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
    at com.newrelic.agent.Agent.main(Agent.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Added agent switch to start script /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf.20150129_150114 (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
    at com.newrelic.agent.util.EditableFile.backup(EditableFile.java:251)
    at com.newrelic.agent.install.SelfInstaller.backup(SelfInstaller.java:125)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:51)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:37)
    at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
    at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
    at com.newrelic.agent.Agent.main(Agent.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
    at com.newrelic.agent.util.EditableFile.write(EditableFile.java:263)
    at com.newrelic.agent.util.EditableFile.append(EditableFile.java:240)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:55)
    at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:37)
    at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
    at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
    at com.newrelic.agent.Agent.main(Agent.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Added agent switch to start script /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf
No need to create New Relic configuration file because:
 .:. A config file already exists: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/newrelic/newrelic.yml
***** Install successful
***** Next steps:
You're almost done! To see performance data for your app:
 .:. Restart your app server
 .:. Exercise your app
 .:. Log into http://rpm.newrelic.com
Within two minutes, your app should show up, ready to monitor and troubleshoot.
If app data doesn't appear, check newrelic/logs/newrelic_agent.log for errors.

我该如何安装它?我在哪里可以获得许可?

4

1 回答 1

0

Looks like NewRelic is attempting to create a backup of the WildFly configuration file which it finds at ~/wildfly/bin/standalone.conf. Unfortunately it fails due because the ~/wildfly/bin is locked by the WildFly cartridge as you can see by its permissions and entry in the cartridge's managed_files.yml:

\> ls -ld wildfly/bin/
drwxr-xr-x. 6 root 544c2c3be0b8cdf8da000253 4096 Dec 23 20:01 wildfly/bin/

\> cat wildfly/metadata/managed_files.yml
---
[...]
locked_files:
- bin/
- bin/*
[...]

I see three options, in order of complexity.

  1. See if newrelic.jar accepts an flag to not perform a backup of the config file.

  2. Since it looks like newrelic.jar is trying to automatically modify standalone.conf for you, try running this step on a local environment with WildFly where you do have permissions. Then check in the new standalone.conf to OpenShift git.

  3. Fork the WildFly cart repo and remove the bin/ and bin/* entries from the locked_files key in managed_files.yml. But make sure to create these manually within the cart's bin/setup script, as locking would normally do that for you. See Locking cartridges for more info.

于 2015-01-29T22:03:45.087 回答