我无法让主管上班;启动过程后:
# supervisord -n -c /etc/supervisord.conf
2013-05-29 11:34:11,861 CRIT Supervisor running as root (no user in config file)
2013-05-29 11:34:11,868 INFO supervisord started with pid 7893
Run Code Online (Sandbox Code Playgroud)
从另一个终端,我得到:
# supervisorctl -c supervisord.conf status
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
Run Code Online (Sandbox Code Playgroud)
在无业游民中运行,CentOS 6.3 x86_64。
配置:
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=500MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main …Run Code Online (Sandbox Code Playgroud) 根据文档 ( http://supervisord.org/configuration.html),Supervisor将使用它找到的第一个文件。
1) $CWD/supervisord.conf 2) $CWD/etc/supervisord.conf 3) /etc/supervisord.conf
我正在比较两台机器,它们都没有/etc/supervisord.conf。
但是,对于其中之一,无论我从哪里运行命令,都可以运行以下命令:
sudo supervisorctl status
Run Code Online (Sandbox Code Playgroud)
可能有其他设置或环境变量吗?
我如何才能找到它在运行时实际使用的配置文件?有详细模式吗?
我很迷惑。
谢谢
我将从我的用例开始,因为我很可能没有使用正确的工具来完成这项工作。如果我以错误的方式处理这件事,请告诉我
用例:我有一个 CentOS 服务器托管多个 Web 应用程序。我希望能够相信我的 Web 服务器和应用程序服务器将运行。我的堆栈看起来像
我想用supervisord来监控nginx和uWSGI。在我的 /etc/supervisor.conf 中,我有
[program:nginxgo]
command = /usr/sbin/nginx
autostart=true
autorestart=unexpected
exitcodes=0
stdout_logfile=/home/webdev/nginxgo.log
stderr_logfile=/home/webdev/nginxgoerr.log
[program:uwsgi_emperor_go]
command = uwsgi --emperor /etc/uwsgi/emperor.ini
autostart=true
autorestart=unexpected
stopsignal=INT
stdout_logfile=/home/webdev/emp.log
stderr_logfile=/home/webdev/emperr.log
directory=/home/webdev/
user=webdev
Run Code Online (Sandbox Code Playgroud)
我启动了 uWSGI 进程。当我进入[root@mymachine]# /usr/local/bin/supervisord -n -c /etc/supervisord.conf
输出是
2014-11-26 14:07:56,917 CRIT Supervisor running as root (no user in config file)
2014-11-26 14:07:56,951 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2014-11-26 14:07:56,952 INFO supervisord started with pid 31068
2014-11-26 14:07:57,957 …Run Code Online (Sandbox Code Playgroud) 我在使用主管将 Sentry(https://www.getsentry.com - 没有足够的链接代表)作为服务运行时遇到问题。我可以在命令行中运行 Sentry 并在浏览器中正确查看它,但是当涉及到主管时,我完全一无所知。
我会尽力提供我能提供的所有细节
初始用户警告
设置:
遵循指示
我的主管ini(哨兵部分)
[program:sentry-web]
directory=/root/.virtualenvs/sentry/
command= start http /root/.virtualenvs/sentry/bin/sentry
autostart=true
autorestart=true
redirect_stderr=true
Run Code Online (Sandbox Code Playgroud)
好的,我们开始:
当我运行时,supervisord -n我收到以下消息,而不是一个很好的 Web 界面。
2012-04-12 23:48:09,024 CRIT Supervisor running as root (no user in config file)
2012-04-12 23:48:09,097 INFO RPC interface 'supervisor' initialized
2012-04-12 23:48:09,099 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2012-04-12 …Run Code Online (Sandbox Code Playgroud) 有没有办法在前台模式下运行 supervisord 本身?或者是否有另一个应用程序可以运行/监督多个应用程序并在其自身收到 SIGTERM 或等效信息时将其关闭。
我们[inet_http_server]在127.0.0.1:9001.
当我们试图将它放在 nginx 后面时 - supervisord logtail 停止工作。
主管设置:
[inet_http_server]
port = 127.0.0.1:9001
Run Code Online (Sandbox Code Playgroud)
Nginx 设置:
server {
listen 80;
server_name server.com;
location / {
proxy_pass http://127.0.0.1:9001/;
}
}
Run Code Online (Sandbox Code Playgroud)
去哪里挖?(Stop | Start | Restart) 命令有效,只有 tail 命令无效。
我supervisord在 Docker 容器内使用来管理我正在运行的进程,并且还想使用它来触发某些命令 - 运行它们一次并期望它们以0.
下面是一个例子:
[program:central-seed-posts]
command = /usr/bin/php /var/www/app/artisan post
autostart = false
autorestart = false
startsecs = 3
startretries = 0
exitcodes = 0
stderr_logfile=/tmp/central/posts-stderr-supervisor.log
stdout_logfile=/tmp/central/posts-stdout-supervisor.log
Run Code Online (Sandbox Code Playgroud)
我正在使用nsenter 的 docker-enterwithsupervisorctl start central-seed-posts来触发它,但我也想处理成功退出而不是主管告诉我ERROR (abnormal termination)
它与主管事件有关吗?
我正在尝试使用 apache2 和 nginx 使用 php7.0-fpm 构建一个 dockerized ubuntu 16.04lts
我使用过但没有用的命令
[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 --daemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Run Code Online (Sandbox Code Playgroud)
和
[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 -c /etc/php/7.0/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Run Code Online (Sandbox Code Playgroud)
和
[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 -c /etc/php/7.0/fpm
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Run Code Online (Sandbox Code Playgroud)
以下是我尝试作为容器运行时来自 docker 的错误日志
从 apache2 容器
2016-06-26 20:04:21,488 CRIT Set uid to user 0
2016-06-26 20:04:21,496 INFO RPC interface 'supervisor' initialized
2016-06-26 20:04:21,496 CRIT Server 'unix_http_server' running …Run Code Online (Sandbox Code Playgroud) 我需要将多个环境变量代理/etc/environment到由supervisor.
以下配置对我有用,supervisor 3.0r1-1但supervisor 3.2.0-2报告错误:
environment=FOO=$FOO,BAR=$BAR,BAZ=$BAZ
Run Code Online (Sandbox Code Playgroud)
错误:值中的键/值对意外结束...
一些答案建议引用这些值,但如果我这样做,变量将不会扩展为实际值。
我究竟做错了什么?如何解决?
作为 ec2 用户:
[ec2-user@stg etc]$ sudo supervisorctl status
sudo: supervisorctl: command not found
Run Code Online (Sandbox Code Playgroud)
作为根:
[ec2-user@stg etc]$ sudo su -
Last login: Tue Jun 6 03:02:55 UTC 2017 on pts/1
[root@stg ~]# supervisorctl status
kafka BACKOFF Exited too quickly (process log may have details)
zookeeper RUNNING pid 24697, uptime 0:25:11
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么会发生这种情况。我检查了 sudoers 文件,但没有找到有意义的东西。请帮忙。