Openshift:安装New Relic Jar文件时拒绝权限

时间:2015-01-29 20:13:01

标签: openshift newrelic newrelic-platform

我正在尝试将新文件jar安装到我的Openshift应用程序(wildfly cartridge),但它失败了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.

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

1 个答案:

答案 0 :(得分:0)

看起来NewRelic正在尝试创建它在~/wildfly/bin/standalone.conf找到的WildFly配置文件的备份。不幸的是,它失败了,因为WildFly磁带已将~/wildfly/bin 锁定,因为您可以通过其权限和条目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/*
[...]

我看到三个选项,按复杂程度排列。

  1. 查看newrelic.jar是否接受了不执行配置文件备份的标志。

  2. 由于看起来newrelic.jar正在尝试自动修改standalone.conf,请尝试在具有权限的WildFly的本地环境中运行此步骤。然后检查新的standalone.conf到OpenShift git。

  3. 分叉WildFly cart repo并从bin/中的bin/*键中删除locked_filesmanaged_files.yml条目。但请确保在购物车的bin/setup脚本中手动创建这些内容,因为锁定通常会为您执行此操作。有关详细信息,请参阅Locking cartridges