1.打開配置文件
nano /etc/supervisord.conf
2.修改后如下內容:
unix_http_server結點
[unix_http_server] ;file=/tmp/supervisor.sock ; (the path to the socket file) file=/var/run/supervisor.sock ;
supervisord結點
[supervisord] ;logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) logfile=/var/log/supervisord.log ;
supervisorctl結點
[supervisorctl] ;serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
serverurl=unix:///var/run/supervisor.sock ;
3.修改后保存文件
參考文檔:
解決unix:///tmp/supervisor.sock no such file的問題
"unix:///tmp/supervisor.sock no such file" 錯誤處理 (親測)
這種方法,我改了之后,並不管用,所以配置文件又改回去了
又試了這種方法:這里注意 supervisord.conf文件的路徑(這回管用了)
執行命令報錯:
[root@67 etc]# /usr/bin/python2 /usr/bin/supervisord -c /etc/supervisord.conf Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord. For help, use /usr/bin/supervisord -h
解決辦法
Terminal上輸入
ps -ef | grep supervisord
獲取所有supervisord正在運行的pid
root 2503 1 0 Nov19 ? 00:03:23 /usr/bin/python /usr/bin/supervisord
root 21337 2556 0 18:15 pts/8 00:00:00 grep --color=auto supervisord
pid=2503
kill -s SIGTERM 2503
之后在重新執行
supervisord -c /etc/supervisord.conf
后記---這個問題又在反復的出現誒
先是這個問題
(gotest_official) [root@devops-testserver01 gotest_official]# supervisord -c /etc/supervisord.conf Unlinking stale socket /data/logs/supervisor/supervisor.sock
試了
(gotest_official) [root@devops-testserver01 gotest_official]# unlink /data/logs/supervisor/supervisor.sock (gotest_official) [root@devops-testserver01 gotest_official]# supervisorctl status unix:///data/logs/supervisor/supervisor.sock no such file
之后就又出現no such file的問題
換了一台服務器,現在第2種方法也不試用了
首先根據百度的結果,造成這個問題的原因是:使用systemctl enable supervisord 設置開機啟動,一般就不會出現 socker文件不存在的問題了
參考文檔:
解決unix:///tmp/supervisor.sock no such file的問題
執行命令 supervisorctl 就可以看到你的進程狀態了
[root@devops-testserver01 app_user_5i5j]# supervisorctl gotest RUNNING pid 15897, uptime 0:00:03 supervisor>
蒙,進行了一堆操作,一直都有異常問題,執行命令supervisorctl也看不到gotest任務有啟動着,但是去了個廁所,他竟然神奇的好了
這是什么情況。。。納尼???
我回憶,我進行的關鍵的操作是在/data/logs/supervisor/這個目錄下創建了 supervisor.sock這個文件,文件內容為空,操作權限為777

我參考的文檔有:
解決unix:///tmp/supervisor.sock no such file的問題
解決unix:///var/run/supervisor.sock no such file
解決unix:///var/run/supervisor.sock no such file
解決unix:///tmp/supervisor.sock no such file的問題
