我有一个用于在 elasticsearch 上发出警报的插件。
这是每次手动运行
python -m elastalert.elastalert --verbose --rule example_frequency.yaml
Run Code Online (Sandbox Code Playgroud)
通过这种方式,必须为它专门设置一个屏幕,我希望它在后台运行。
此任务可以通过两种方式完成,我使用Supervisor或systemd。
我所要做的就是为其中任何一个编写脚本。
但是我应该在生产中实际使用什么?
这两者的优缺点是什么?
root@dev-demo-karl:/srv/www# supervisord -v
3.3.1
Run Code Online (Sandbox Code Playgroud)
试图让supervisorctl工作:
root@dev-demo-karl:/srv/www# supervisorctl
http://localhost:9001 refused connection
Run Code Online (Sandbox Code Playgroud)
我的配置:
[supervisord]
nodaemon=true
[supervisorctl]
Run Code Online (Sandbox Code Playgroud) Supervisorctl 似乎不让我进来:
$ supervisorctl -c /etc/supervisor/supervisord.conf
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
$ cat /etc/supervisor/supervisord.conf
[supervisord]
nodaemon=true
Run Code Online (Sandbox Code Playgroud)
我都指定了 config 和[supervisord]. 我的配置有可能在错误的地方吗?
阅读该问题后,我意识到我需要安装supervisor.
sudo apt-get install supervisor 告诉我:
E: Unable to locate package supervisor
Run Code Online (Sandbox Code Playgroud)
sudo apt-cache search supervisor 什么都不给。
此外,当我查看其他问题时,它似乎默认安装在 Ubuntu 16.04 中。
我正在使用 Ubuntu 16.04 LTS。
为什么我找不到这个包?我该如何安装?