我正在尝试按如下方式运行主管:
azure@G01:~$sudo supervisord -c /etc/supervisor/supervisord.conf
我尝试了尽可能多的问题排查,但毫无结果。我不知道问题出在哪里。我甚至使用同一个用户 azure 和 0777 手动创建了文件 /var/run/supervisor.sock,但还是没用。
错误:无法打开 HTTP 服务器:socket.error 报告 errno.EADDRNOTAVAIL (99) 如需帮助,请使用 /usr/bin/supervisord -h
这是我的supervisord.conf
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0777 ; sockef file mode (default 0700)
[inet_http_server] ; inet (TCP) server disabled by default
port=X.X.X.180:9001 ; (ip_address:port specifier, *:port for all iface)
username=xxxxx; (default is no username (open server))
password=xxxxx@2024 ; (default is no password (open server))
[supervisord]
logfile=/var/www/html/mywebsite.com/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf
答案1
此问题取决于您使用的服务器。我使用的是 Azure 服务器。我解决问题的唯一方法是使用 0.0.0.0 作为 IP 地址。
[inet_http_server] ; inet (TCP) server disabled by default
port=0.0.0.0:9001 ; (ip_address:port specifier, *:port for all iface)
这篇文章对我有帮助:NodeJS-错误:监听 EADDRNOTAVAIL:地址不可用