Suervisor http://localhost:9001 refused connection

python 复制代码
(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目录下

python 复制代码
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、就需要通过指定配置文件来执行了,命令如下:

python 复制代码
./bin/supervisord -c etc/supervisord_core.conf
然后便可启动了
./bin/supervisorctl -c etc/supervisord_core.conf status  # 可通过如下查询状态

   
   
   
                
python 复制代码
(desk_env) root@vdi:/opt/pyenv/desk_env/bin# ./supervisorctl -c /opt/desk/vdi-server/supervisord.conf
相关推荐
橘子真甜~2 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
Allen正心正念20253 小时前
网络编程与通讯协议综合解析
网络
bing_feilong3 小时前
ubuntu中的WIFI与自身热点切换
网络
CodeByV3 小时前
【网络】UDP 协议深度解析:从五元组标识到缓冲区
网络·网络协议·udp
车载测试工程师4 小时前
CAPL学习-AVB交互层-概述
网络协议·tcp/ip·以太网·capl·canoe
虹科网络安全4 小时前
艾体宝洞察 | 利用“隐形字符”的钓鱼邮件:传统防御为何失效,AI安全意识培训如何补上最后一道防线
运维·网络·安全
石像鬼₧魂石4 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
鲸鱼电台分台6 小时前
工业应用通信协议:IEC104
网络协议
适应规律6 小时前
UNeXt-Stripe网络架构解释
网络
纸带7 小时前
USB通信的状态
网络