name: Deployment with Supervisord
sort: 2
Supervisord
Supervisord Python ile oluşturulmuş çok kullanışlı bir process (süreç) yöneticisidir. Supervisord deamon olmayan uygulamalarınızı deamon uygulamaya çevirir.
Eğer Supervisord kullanarak nginx’i yönetmek isterseniz deamon özelliğini kapatıp nginx’i deamon olmayan modda çalıştırmanız gerekmektedir.
Supervisord Kurulumu
Kurulum dosyalarını yükleme
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.eggsh setuptools-0.6c11-py2.7.eggeasy_install supervisorecho_supervisord_conf >/etc/supervisord.confmkdir /etc/supervisord.conf.d
config
/etc/supervisord.conf[include]files = /etc/supervisord.conf.d/*.conf
Yönetmek için yeni bir uygulama oluşturulur
cd /etc/supervisord.conf.dvim beepkg.conf
Konfigürasyonlar :
[program:beepkg]directory = /opt/app/beepkgcommand = /opt/app/beepkg/beepkgautostart = truestartsecs = 5user = rootredirect_stderr = truestdout_logfile = /var/log/supervisord/beepkg.log
Supervisord Yönetimi
Supervisord iki komut ile çalışır, supervisord ve supervisorctl :
- supervisord: Supervisord’u hazır hale getirir ve config edilmiş processleri çalıştırır.
- supervisorctl stop programxxx: programxxx processlerini durdurur. programxxx [program:beepkg] adıyla config edilir. (beepkg)
- supervisorctl start programxxx: Process çalıştırır.
- supervisorctl restart programxxx: Processleri tekrar çalıştırır.
- supervisorctl stop groupworker: Groupworker grubundaki tüm processleri tekrar çalıştırır.
- supervisorctl stop all: Tüm processleri durdurur. Not : start, stop, restart ve stop son configleri yenilemez (reload yapmaz)
- supervisorctl reload: Tüm configleri yeniler
- supervisorctl update: Tüm processleri değişen configleriyle beraber yeniler.
Not :
stopkomutuyla manuel olarak durdurulan processler, reload veya update işlemlerinden sonra yeniden başlamayacaklardır.
