将新遗物与芹菜相结合



我正在尝试配置New Relic以与Celery一起使用。 我正在开发一个托管在带有 CentOS 7 的 Amazon EC2 上的 Django 应用程序。

我认为为芹菜配置New Relic所需要做的就是在/etc/systemd/system/celery.service中编辑以下行:

ExecStart=/home/myuser/project/venv/bin/celery -A project worker -l info -c 4



并将其更改为:

ExecStart=/home/myuser/project/newrelic.ini newrelic-admin run-program celery -A project worker -l info -c 4

但是我看到以下错误:

[root@ip-172-31-60-222 system]# systemctl daemon-reload
[root@ip-172-31-60-222 system]# systemctl restart celery
[root@ip-172-31-60-222 system]# systemctl status celery.service -l
● celery.service - datasidekick celery service
Loaded: loaded (/etc/systemd/system/celery.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Wed 2017-03-01 04:16:33 UTC; 900ms ago
Process: 22969 ExecStart=/home/datasidekick/datasidekick/newrelic.ini newrelic-admin run-program /home/datasidekick/datasidekick/venv/bin/celery -A datasidekick worker -l info -c 4 (code=exited, status=203/EXEC)
Main PID: 22969 (code=exited, status=203/EXEC)
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: Unit celery.service entered failed state.
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: celery.service failed.
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: celery.service holdoff time over, scheduling restart.
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: start request repeated too quickly for celery.service
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: Failed to start datasidekick celery service.
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: Unit celery.service entered failed state.
Mar 01 04:16:33 ip-172-31-60-222.ec2.internal systemd[1]: celery.service failed.

我不确定我做错了什么。 任何帮助将不胜感激!

自从你问这个问题以来已经有一段时间了,但失败的原因可能是错误的ExecStart命令。

您可以使用/home/myuser/project/newrelic.ini newrelic-admin run-program celery -A project worker -l info -c 4作为启动服务的命令。该命令的第一部分将尝试执行/home/myuser/project/newrelic.ini,这是一个文本文件,并失败并出现错误Permission denied因为默认情况下文本文件没有exec权限。否则,它将在某处导致bash语法错误并失败。

英斯商学院,使用

Environment="NEW_RELIC_CONFIG_FILE=/home/myuser/project/newrelic.ini"
ExecStart=newrelic-admin run-program celery -A project worker -l info -c 4

运行journalctl -u celery -f并在此处粘贴日志 也看看这个链接

https://docs.newrelic.com/docs/agents/python-agent/back-end-services/python-agent-celery

https://discuss.newrelic.com/t/need-some-help-setting-up-new-relic-with-our-celery-workers/30181

相关内容

  • 没有找到相关文章

最新更新