I'm using django-gunicorn-nginx setup by following this tutorial http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/ Upto nginx setup, it is working. Then I installed supervisor, configured it and then I reboot my server and checked, it shows 502 bad gateway. I'm using Ubuntu 12.04 LTS
我正在使用django-gunicorn-nginx安装,通过遵循本教程http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/ Upto nginx安装,它正在工作。然后我安装了监督员,配置它,然后我重新启动我的服务器,检查,它显示502坏网关。我用的是Ubuntu 12.04 LTS
/etc/supervisor/conf.d/qlimp.conf
/etc/supervisor/conf.d/qlimp.conf
[program: qlimp]
directory = /home/nirmal/project/qlimp/qlimp.sh
user = nirmal
command = /home/nirmal/project/qlimp/qlimp.sh
stdout_logfile = /path/to/supervisor/log/file/logfile.log
stderr_logfile = /path/to/supervisor/log/file/error-logfile.log
Then I restarted supervisor and I run this command $ supervisorctl start qlimp
and I'm getting this error
然后我重启监控器,运行这个命令$ monitsorctl start qlimp我得到这个错误
unix:///var/run/supervisor.sock no such file
Is there any problem in my supervisor setup?
我的主管设置有问题吗?
Thanks!
谢谢!
9 个解决方案
#1
65
That there is no socket file probably means that supervisor isn't running. A reason that it isn't running might be that your qlimp.conf file has some sort of error in it. If you do a
没有套接字文件可能意味着主管没有运行。它不运行的一个原因可能是您的qlimp。conf文件中有一些错误。如果你做一个
sudo service supervisor start
you can see whether or not this is the case. If supervisor is already running, it will say. And if it is catching an error, it will usually give you a more helpful error message than supervisorctl.
你可以看看是不是这样。如果主管已经在运行,它会说。如果它捕捉到一个错误,它通常会给你一个比monitorctl更有用的错误信息。
#2
25
I have met the same issue as you and after several times, here comes the solution:
我和你遇到过同样的问题,过了好几次,解决办法来了:
-
First remove the apt-get supervisor version:
首先删除apt-get管理器版本:
sudo apt-get remove supervisor
-
Kill the backend supervisor process:
终止后台管理程序:
sudo ps -ef | grep supervisor
-
Then get the newest version(apt-get version was 3.0a8):
然后获取最新版本(apt-get版本为3.0a8):
sudo easy_install(pip install) supervisor==3.0b2
-
Echo the config file(root premission):
回显配置文件(root premission):
echo_supervisord_conf > /etc/supervisord.conf
5.Start supervisord:
5。开始supervisord:
sudo supervisord
6.Enter supervisorctl:
6。输入supervisorctl:
sudo supervisorctl
Anything has been done! Have fun!
任何已经完成!玩得开心!
#3
16
Try this
试试这个
cd /etc/supervisor
sudo supervisord
sudo supervisorctl restart all
#4
12
Are you sure that supervisord is installed and running? Is there a socket file in present at /var/run/supervisor.sock
?
您确定管理器已经安装并运行了吗?在/var/run/ monitor .sock .sock .袜子中是否有套接字文件?
The error indicates that supervisorctl
, the control CLI, cannot reach the UNIX socket to communicate with supervisord
, the daemon.
该错误表明,控制CLI的monitsorctl无法到达UNIX套接字与守护进程监理方进行通信。
You could also check /etc/supervisor/supervisord.conf
and see if the values for the unix_http_server
and supervisorctl
sections match.
你也可以检查/etc/ supervision / supervision sord。conf并查看unix_http_server和monitsorctl节的值是否匹配。
Note that this is a Ubuntu-level problem, not a problem with Python, Django or nginx and as such this question probably belongs on ServerFault.
注意,这是一个ubuntu级别的问题,不是Python、Django或nginx的问题,因此这个问题可能属于ServerFault。
#5
9
On Ubuntu 16+ it seems to been caused by the switch to systemd, this workaround may fix for new servers:
在Ubuntu 16+上,这似乎是由于切换到systemd引起的,这个解决方案可以修复新服务器:
# Make sure Supervisor comes up after a reboot.
$ sudo systemctl enable supervisor
# Bring Supervisor up right now.
$ sudo systemctl start supervisor
and then do check your status of iconic.conf [My example] of supervisor
然后检查你的图标状态。这是我的例子
$ sudo supervisorctl status iconic
PS: Make sure gunicorn should not have any problem while running.
注意:在跑步的时候,冈尼康应该没有任何问题。
#6
4
The error maybe due to that you don't have privilege. Maybe you can fix the error by this way,open your terminal,and input vim /etc/supervisord.conf
to edit the file,search the lines
这个错误可能是因为你没有特权。也许您可以通过这种方式修复错误,打开您的终端,并输入vim /etc/ monitsord。编辑文件,搜索行
[unix_http_server]
;file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; socket file mode (default 0700)
[unix_http_server];文件= / tmp /主管。袜子;(套接字文件的路径);chmod=0700;套接字文件模式(默认为0700)
and delete the Semicolon in the start of the string ;file=/tmp/supervisor.sock
and ;chmod=0700
,restart your supervisord.I suggest you do it.
并删除字符串开头的分号;file=/tmp/supervisor。chmod=0700,重新启动你的主管。我建议你去做。
#7
2
Make sure that in /etc/supervisor.conf
the following two sections exists
确保在/etc/supervisor中。如果存在以下两个部分
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
#8
2
You can do something like this :-
你可以这样做:-
sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart
It's definitely work, try this.
这绝对是工作,试试这个。
#9
1
In my case, Supervisor was not running. To spot the issue I run:
在我的情况下,主管没有运行。为了发现我所面临的问题:
sudo systemctl status supervisor.service
The problem was that I had my logs pointing to a non-existing directory, so I just had to create it.
问题是我的日志指向一个不存在的目录,所以我必须创建它。
I hope it helps :)
我希望它能有所帮助。
#1
65
That there is no socket file probably means that supervisor isn't running. A reason that it isn't running might be that your qlimp.conf file has some sort of error in it. If you do a
没有套接字文件可能意味着主管没有运行。它不运行的一个原因可能是您的qlimp。conf文件中有一些错误。如果你做一个
sudo service supervisor start
you can see whether or not this is the case. If supervisor is already running, it will say. And if it is catching an error, it will usually give you a more helpful error message than supervisorctl.
你可以看看是不是这样。如果主管已经在运行,它会说。如果它捕捉到一个错误,它通常会给你一个比monitorctl更有用的错误信息。
#2
25
I have met the same issue as you and after several times, here comes the solution:
我和你遇到过同样的问题,过了好几次,解决办法来了:
-
First remove the apt-get supervisor version:
首先删除apt-get管理器版本:
sudo apt-get remove supervisor
-
Kill the backend supervisor process:
终止后台管理程序:
sudo ps -ef | grep supervisor
-
Then get the newest version(apt-get version was 3.0a8):
然后获取最新版本(apt-get版本为3.0a8):
sudo easy_install(pip install) supervisor==3.0b2
-
Echo the config file(root premission):
回显配置文件(root premission):
echo_supervisord_conf > /etc/supervisord.conf
5.Start supervisord:
5。开始supervisord:
sudo supervisord
6.Enter supervisorctl:
6。输入supervisorctl:
sudo supervisorctl
Anything has been done! Have fun!
任何已经完成!玩得开心!
#3
16
Try this
试试这个
cd /etc/supervisor
sudo supervisord
sudo supervisorctl restart all
#4
12
Are you sure that supervisord is installed and running? Is there a socket file in present at /var/run/supervisor.sock
?
您确定管理器已经安装并运行了吗?在/var/run/ monitor .sock .sock .袜子中是否有套接字文件?
The error indicates that supervisorctl
, the control CLI, cannot reach the UNIX socket to communicate with supervisord
, the daemon.
该错误表明,控制CLI的monitsorctl无法到达UNIX套接字与守护进程监理方进行通信。
You could also check /etc/supervisor/supervisord.conf
and see if the values for the unix_http_server
and supervisorctl
sections match.
你也可以检查/etc/ supervision / supervision sord。conf并查看unix_http_server和monitsorctl节的值是否匹配。
Note that this is a Ubuntu-level problem, not a problem with Python, Django or nginx and as such this question probably belongs on ServerFault.
注意,这是一个ubuntu级别的问题,不是Python、Django或nginx的问题,因此这个问题可能属于ServerFault。
#5
9
On Ubuntu 16+ it seems to been caused by the switch to systemd, this workaround may fix for new servers:
在Ubuntu 16+上,这似乎是由于切换到systemd引起的,这个解决方案可以修复新服务器:
# Make sure Supervisor comes up after a reboot.
$ sudo systemctl enable supervisor
# Bring Supervisor up right now.
$ sudo systemctl start supervisor
and then do check your status of iconic.conf [My example] of supervisor
然后检查你的图标状态。这是我的例子
$ sudo supervisorctl status iconic
PS: Make sure gunicorn should not have any problem while running.
注意:在跑步的时候,冈尼康应该没有任何问题。
#6
4
The error maybe due to that you don't have privilege. Maybe you can fix the error by this way,open your terminal,and input vim /etc/supervisord.conf
to edit the file,search the lines
这个错误可能是因为你没有特权。也许您可以通过这种方式修复错误,打开您的终端,并输入vim /etc/ monitsord。编辑文件,搜索行
[unix_http_server]
;file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; socket file mode (default 0700)
[unix_http_server];文件= / tmp /主管。袜子;(套接字文件的路径);chmod=0700;套接字文件模式(默认为0700)
and delete the Semicolon in the start of the string ;file=/tmp/supervisor.sock
and ;chmod=0700
,restart your supervisord.I suggest you do it.
并删除字符串开头的分号;file=/tmp/supervisor。chmod=0700,重新启动你的主管。我建议你去做。
#7
2
Make sure that in /etc/supervisor.conf
the following two sections exists
确保在/etc/supervisor中。如果存在以下两个部分
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
#8
2
You can do something like this :-
你可以这样做:-
sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart
It's definitely work, try this.
这绝对是工作,试试这个。
#9
1
In my case, Supervisor was not running. To spot the issue I run:
在我的情况下,主管没有运行。为了发现我所面临的问题:
sudo systemctl status supervisor.service
The problem was that I had my logs pointing to a non-existing directory, so I just had to create it.
问题是我的日志指向一个不存在的目录,所以我必须创建它。
I hope it helps :)
我希望它能有所帮助。