5 supervisor安裝使用

2022-02-25 11:42:58 字數 1458 閱讀 8950

官方文件

1、安裝

yum install supervisor 

開機啟動

systemctl enable supervisord.service

2、配置檔案

mkdir /etc/supervisor

echo_supervisord_conf > /etc/supervisor/supervisord.conf

修改新建的supervisord.conf配置資訊

最後兩行

[include]

files = /etc/supervisor/conf.d/*.ini

然後修改【inet-http_srever】節點

這裡貌似有個坑,這個埠最好別用9001,不知道什麼情況會觸發埠占用

/etc/supervisor/目錄下建立名字為conf.d資料夾,在conf.d目錄中建gameapi.ini檔案,內容如下

設定一下開機啟動的配置

3、啟動 supervisor

supervisord -c /etc/supervisor/supervisord.conf

檢視我們的程式是否啟動成功

這個工具只能單點使用,比如你自己弄個遊戲key服務,或者是自己的開發除錯,如果集群的話,不太友好,所以知道一下就可以了

附錄[unit]

description=process monitoring and control daemon

after=rc-local.service

[service]

type=forking

execstart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf

execstop=/usr/bin/supervisorctl shutdown

execreload=/usr/bin/supervisorctl reload

runtimedirectory=supervisor

runtimedirectorymode=755

[install]

wantedby=multi-user.target

安裝使用supervisor

yum install python setuptools easy install supervisor 測試安裝是否成功 echo supervisord conf 2.建立配置檔案 建立supervisor配置檔案目錄 etc supervisor mkdir m 755 p etc supe...

supervisor 安裝使用

安裝supervisor yum install supervisor y 更改配置檔案 vim etc supervisord.conf 新增一行配置 include files etc supervisord.d conf.d conf 儲存退出 啟動 supervisord c etc sup...

supervisor 安裝和使用

今天第一次在csdn上面寫部落格,希望以後能寫出更多的部落格。廢話不多說進入主題。supervisor是什麼?supervisor是python寫的程序管理工具可以,可以在linux環境下面監控程序,並且當程序掛掉的時候自動的拉起程序。supervisor在linux環境安裝時安裝上去了,也配置了配...