(desk_env) root@vdi:/opt/pyenv/desk_env/bin# supervisorctl
http://localhost:9001 refused connection
当后台启动supervisord后,使用supervisorctl命令进行任务管理时,
一、报错原因:
http://localhost:9001 refused connection
显示拒绝连接
二、问题原因分析:
因为supervisor通常有以下两种方式通信:
1、本地socket
2、http连接
在supervisor.conf配置文件中,启用socket连接,注释http方式,supervisorctl配置项也使用unix socket
[unix_http_server]
file=/var/run/supervisor.sock ; the path to the socket file
;chmod=0700 ; socket file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; default is no username (open server)
;password=123 ; default is no password (open server)
;[inet_http_server] ; inet (TCP) server disabled by default
;port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface
;username=user ; default is no username (open server)
;password=123 ; default is no password (open server)
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as in [_http_server] if set
;password=123 ; should be same as in [_http_server] if set
;prompt=mysupervisor ; cmd line prompt (default “supervisor”)
;history_file=~/.sc_history ; use readline history if available
但是在启动supervisorctl时,未指定配置文件,因此会使用默认的http方式连接supervisord,最终导致报错
三、解决方案:
1、首先需要进入到对应的supervisor目录下文章来源:https://www.toymoban.com/news/detail-857113.html
cd /opt/typhoonae/
source appenv3/bin/activate # 激活supervosor服务环境
./bin/supervisord # 启动supervosrd
2、可通过./bin/supervisorctl status 查询服务进程状态
3、如果启动 ./bin/supervisorctl -c etc/supervisord_core.conf 显示连接错误,
报错如下:
http://localhost:9002 refused connection
4、就需要通过指定配置文件来执行了,命令如下:文章来源地址https://www.toymoban.com/news/detail-857113.html
./bin/supervisord -c etc/supervisord_core.conf
然后便可启动了
./bin/supervisorctl -c etc/supervisord_core.conf status # 可通过如下查询状态
(desk_env) root@vdi:/opt/pyenv/desk_env/bin# ./supervisorctl -c /opt/desk/vdi-server/supervisord.conf
当后台启动supervisord后,使用supervisorctl命令进行任务管理时,
一、报错原因:
http://localhost:9001 refused connection
显示拒绝连接
二、问题原因分析:
因为supervisor通常有以下两种方式通信:
1、本地socket
2、http连接
在supervisor.conf配置文件中,启用socket连接,注释http方式,supervisorctl配置项也使用unix socket
[unix_http_server]
file=/var/run/supervisor.sock ; the path to the socket file
;chmod=0700 ; socket file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; default is no username (open server)
;password=123 ; default is no password (open server)
;[inet_http_server] ; inet (TCP) server disabled by default
;port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface
;username=user ; default is no username (open server)
;password=123 ; default is no password (open server)
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as in [_http_server] if set
;password=123 ; should be same as in [_http_server] if set
;prompt=mysupervisor ; cmd line prompt (default “supervisor”)
;history_file=~/.sc_history ; use readline history if available
但是在启动supervisorctl时,未指定配置文件,因此会使用默认的http方式连接supervisord,最终导致报错
三、解决方案:
1、首先需要进入到对应的supervisor目录下
cd /opt/typhoonae/
source appenv3/bin/activate # 激活supervosor服务环境
./bin/supervisord # 启动supervosrd
2、可通过./bin/supervisorctl status 查询服务进程状态
3、如果启动 ./bin/supervisorctl -c etc/supervisord_core.conf 显示连接错误,
报错如下:
http://localhost:9002 refused connection
4、就需要通过指定配置文件来执行了,命令如下:
./bin/supervisord -c etc/supervisord_core.conf
然后便可启动了
./bin/supervisorctl -c etc/supervisord_core.conf status # 可通过如下查询状态
到了这里,关于Suervisor http://localhost:9001 refused connection的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!