關(guān)于 supervisor 進(jìn)程管理問題
- 通過設(shè)置 priority 并無法解決 worker 進(jìn)程啟動(dòng)完畢之后再啟動(dòng) flower 的樣子
priority 只是定義了啟動(dòng)順序。
http://supervisord.org/configuration.html
https://github.com/Supervisor/supervisor/issues/122
可以通過設(shè)置 `celery-flower` 的 `autostart=true` 為 `autostart=false` 然后再手動(dòng)進(jìn)行啟動(dòng)
```
$ supervisorctl? ? ? ?
celery-beat? ? ? ? ? ? ? ? ? ? ? STARTING??
celery-flower? ? ? ? ? ? ? ? ? ? STOPPED? ?Not started
celery-worker? ? ? ? ? ? ? ? ? ? STARTING??
supervisor> help
default commands (type help <topic>):
=====================================
add? ? exit? ? ? open? reload? restart? ?start? ?tail? ?
avail? fg? ? ? ? pid? ?remove? shutdown? status? update?
clear? maintail? quit? reread? signal? ? stop? ? version
supervisor> status
celery-beat? ? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37555, uptime 0:00:17
celery-flower? ? ? ? ? ? ? ? ? ? STOPPED? ?Not started
celery-worker? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37556, uptime 0:00:17
supervisor> start celery-flower?
celery-flower: started
supervisor> status
celery-beat? ? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37555, uptime 0:00:41
celery-flower? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37611, uptime 0:00:15
celery-worker? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37556, uptime 0:00:41
supervisor>?
```
或者使用一個(gè)腳本監(jiān)聽 `celery-worker` 的 `status` 進(jìn)行判斷 如果是 `RUNNING` 則可以進(jìn)行啟動(dòng) `celery-flower`
```
$ supervisorctl status celery-worker | awk '{print $2}'
RUNNING
```
2019-08-04
不知道老師有沒有其他解決方案。還望得到回復(fù)。