supervisorctl http://127.0.0.1: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目录下

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  # 可通过如下查询状态
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 1、更新yum 源 [root@bogon ~]# yum -y update ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 2、安装软件 yum install httpd mysql-server php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc -y ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 3、查看php版本 php -version 如果低于5.6则卸载: 查看php版本命令: #php -v 这个命令是删除不干净的 #yum remove php 因为使用这个命令以后再用 #php -v 还是会看到有版本信息的。。。。。 必须强制删除 查询php相关包信息 #rpm -qa|grep php 提示如下 #php-pdo-5.1.6-27.el5_5.3 #php-mysql-5.1.6-27.el5_5.3 #php-xml-5.1.6-27.el5_5.3 #php-cli-5.1.6-27.el5_5.3 #php-common-5.1.6-27.el5_5.3 #php-gd-5.1.6-27.el5_5.3 //卸载php相关所有的 rpm -qa | grep php | xargs rpm -e //https://www.inqingdao.cn/737.html 注意卸载要先卸载没有依赖的 pdo是mysql的依赖项;common是gd的依赖项; 例如:# rpm -e php-pdo-5.1.6-27.el5_5.3 error: Failed dependencies: ? ? ? ? php-pdo is needed by (installed) php-mysql-5.1.6-27.el5_5.3.i386 所以正确的卸载顺序是: # rpm -e php-mysql-5.1.6-27.el5_5.3? # rpm -e php-pdo-5.1.6-27.el5_5.3? # rpm -e php-xml-5.1.6-27.el5_5.3? # rpm -e php-cli-5.1.6-27.el5_5.3? # rpm -e php-gd-5.1.6-27.el5_5.3? # rpm -e php-common-5.1.6-27.el5_5.3? 再用# php -v 查看版本信息已经没有提示 更新php的yum源: # rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm # 安装新版php环境 #yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-odbc.x86_64 php56w-xml.x86_64 php56w-xmlrpc.x86_64 php56w-soap.x86_64 ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 4、启动httpd服务: [root@Shining ~]# service httpd start ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 5、启动Mysql服务 [root@localhost init.d]# service mysqld start 查看端口 ss -tnl 安装完之后开启MySQL服务: 进入mysql [root@Shining ~]# mysql 配置数据库数据 ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 为WordPress在MySQL中创建一个DB及相关用户 #登录MYSQL [root@bogon html]# service mysqld restart [root@bogon html]# mysql mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.00 sec) mysql> create database wordpress; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | | wordpress | +--------------------+ 4 rows in set (0.00 sec) mysql> create user wpuser@localhost; Query OK, 0 rows affected (0.00 sec) mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select User from user; +--------+ | User | +--------+ | root | | | | root | | | | root | | wpuser | +--------+ 6 rows in set (0.00 sec) mysql> update user set password = password("wppassword") where User = 'wpuser'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wpuser@localhost IDENTIFIED BY 'wppassword'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- 6.配置WordPress 下载WordPress的压缩包,并且放到centos系统中。 将该压缩包拷贝到/var/www/html目录,并且解压到该目录,注意压缩包的名称 [root@bogon html]# tar xvf wordpress5.xxx.gz [root@bogon html]# cd /var/www/html 下载wordpress压缩包,并解压到html目录 [root@bogon html]# cd wordpress/ [

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值