Suervisor http://localhost:9001 refused 或 no such file [最全攻略]

Supervisor http://localhost:9001 refused 或 no such file [最全攻略]

造成该原因有以下几种情况:
1 你没有注释掉配置文件中内容
如果你想暴漏出端口进行http服务访问,把9001改成9011或者别的端口试试
如果不想暴漏出来,不需要http服务就全注释掉如下
2 启动命令没有加 配置文件导致默认要发布http服务

1 注释掉如下内容

配置文件: vim /etc/supervisor/supervisord.conf
在这里插入图片描述

2 执行启动命令

supervisord -c /etc/supervisor/supervisord.conf


[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

常见错误

报错:unix:///tmp/supervisor.sock no such file

意思就是没有找到文件,因为tmp中的文件系统会自动清理所有可能导致报错,
解决方法:
把文件换位置,同时修改 supervisor.conf 中的文件路径

1、修改配置

vim /etc/supervisord.conf
进入配置文件,修改所有的tmp的路径

/tmp/supervisor.sock       修改     /var/run/supervisor.sock
/tmp/supervisord.log       修改     /var/log/supervisor.log
/tmp/supervisord.pid       修改     /var/run/supervisor.pid 

2、修改文件权限

sudo chmod 777 /run
sudo chmod 777 /var/log

3、创建supervisor.sock,并修改权限

sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock

然后启动supervisor就可以

报错:unix:///var/run/supervisor.sock refused connection
说明没有启动supervisor,
执行命令就可解决

supervisord -c /etc/supervisord.conf

常用命令

supervisorctl status        //查看所有进程的状态
supervisorctl stop all       //停止所有进程
supervisorctl start all      //启动所有进程
supervisorctl restart       //重启
supervisorctl update        //配置文件修改后使用该命令加载新的配置
supervisorctl reload        //重新启动配置中的所有程序

————————————————

最后大招

如果执行supervisorctl status 等命令不好使,还不好使

执行一下:supervisorctl reload
神奇的一幕出现!

再执行supervisorctl status 命令好使了!

————————————————
如果还不行,给我留言,或者看我其它文档,我打算把整个详细安装过程写一系列,包括mongo、elasticsearch、redis、nginx 等等配置!

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值