μ€ν μ€μΈ Supervisord μΈμ€ν΄μ€μμ "supervisorctl reload"λ₯Ό μ€ννλ©΄ νλ‘κ·Έλ¨μ΄ μ€μ§λκ³ λ€μ μμλμ§ μμ΅λλ€.
3.0a10μμ 3.0a12λ‘ μ κ·Έλ μ΄λν μ΄νμ μ΄λ° μΌμ΄ λ°μνλ κ²μ νμΈνμ΅λλ€. 볡μ ν μ μλ κ²½μ° μΆκ° μ 보λ₯Ό μ 곡ν μ μμ΅λλ€.
λ΄κ° λ§ν μμλ ν 3.0a10κ³Ό 3.0a12 μ¬μ΄μλ μ΄μ κ΄λ ¨λ λ³κ²½ μ¬νμ΄ μμμ΅λλ€. νλ‘κ·Έλ¨μ λν΄ autostart=true
ꡬμ±λμ΄ μμ΅λκΉ?
Ubuntu10.04μμ supervisorctl reload
μΈν΄ Supervisord νλ‘μΈμ€κ° μ€ν¨ν©λλ€. supervisorctl
λ₯Ό μ€ννλ €λ νμ μλλ
unix:///var/run/supervisor.sock no such file
λλ λ λͺ¨νΈν
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
Supervisord νλ‘μΈμ€λ sudo supervisord
νμ¬ μλμΌλ‘ λ€μ μμν΄μΌ ν©λλ€.
μ΄κ²μ μ λ§ λμλ€.
@leopd μ΄ λ²κ·Έμ κ΄λ ¨μ΄ μλ κ² κ°μ΅λλ€. Supervisorctlμ λ©μμ§λ Supervisordμ μ°κ²°ν μ μλ€κ³ λ§ν©λλ€. λ¬΄μ¨ μΌμ΄ μΌμ΄λ¬λμ§ λ³΄λ €λ©΄ κ°λ
μ λ‘κ·Έλ₯Ό νμΈν΄μΌ ν©λλ€. ν¬κ·ΈλΌμ΄λ( supervisord -n
)μμ μ€ννκ³ λ€μ λ‘λνλ λμ μ’
λ£λλμ§ νμΈν μλ μμ΅λλ€.
@mnaberez λλ²κΉ ν μ£Όμ μ κ°μ¬ν©λλ€. μ λ΄κ° λ³΄κ³ μλ κ²μ΄ jbrehhκ° μλ λ³΄κ³ ν κ²κ³Ό λ€λ₯΄λ€κ³ μκ°νλμ§ μ λͺ¨λ₯΄κ² μ΅λλ€. κ·Έλ€μ λμ λμΌνκ² λ€λ¦½λλ€. μ¬λ‘κ° λ€λ₯Έ μ΄μ λ₯Ό μ€λͺ νλ©΄ μ΄μ λν μλ‘μ΄ λ²κ·Έλ₯Ό κΈ°κΊΌμ΄ μ΄μ΄ λ³΄κ² μ΅λλ€. νμ§λ§ κ·Έλ΄ μ΄μ λ μμ΅λλ€.
μ‘°μΈν λλ‘ μ κ²½μμ Supervisordλ₯Ό μ€ννλ κ²½μ° supervisorctl reload
νλ©΄ Supervisordκ° λ€μκ³Ό κ°μ΄ μΆ©λν©λλ€.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/supervisor/loggers.py", line 81, in emit
self.stream.write(msg)
ValueError: I/O operation on closed file
Traceback (most recent call last):
File "/usr/local/bin/supervisord", line 9, in <module>
load_entry_point('supervisor==3.0b1', 'console_scripts', 'supervisord')()
File "/usr/local/lib/python2.6/dist-packages/supervisor/supervisord.py", line 360, in main
go(options)
File "/usr/local/lib/python2.6/dist-packages/supervisor/supervisord.py", line 370, in go
d.main()
File "/usr/local/lib/python2.6/dist-packages/supervisor/supervisord.py", line 77, in main
info_messages)
File "/usr/local/lib/python2.6/dist-packages/supervisor/options.py", line 1274, in make_logger
self.logger.critical(msg)
File "/usr/local/lib/python2.6/dist-packages/supervisor/loggers.py", line 313, in critical
self.log(LevelsByName.CRIT, msg, **kw)
File "/usr/local/lib/python2.6/dist-packages/supervisor/loggers.py", line 319, in log
handler.emit(record)
File "/usr/local/lib/python2.6/dist-packages/supervisor/loggers.py", line 214, in emit
self.doRollover()
File "/usr/local/lib/python2.6/dist-packages/supervisor/loggers.py", line 223, in doRollover
if not (self.stream.tell() >= self.maxBytes):
ValueError: I/O operation on closed file
μ€μνλ€λ©΄ 3.0b1μ μ€ννκ³ μμ΅λλ€.
... 3.0a10μΌλ‘ λλ리면 λ¬Έμ κ° μ¬λΌμ§λλ€.
μ λ΄κ° λ³΄κ³ μλ κ²μ΄ jbrehhκ° μλ λ³΄κ³ ν κ²κ³Ό λ€λ₯΄λ€κ³ μκ°νλμ§ μ λͺ¨λ₯΄κ² μ΅λλ€.
λ΄κ° ν릴 μ μμ§λ§ μλ³Έ λ³΄κ³ μλ₯Ό Supervisord μΆ©λμ΄ μλλΌ Supervisordμμ μ€ν μ€μΈ νλ‘κ·Έλ¨μ΄ λ€μ μμλμ§ μλ κ²μΌλ‘ ν΄μνμ΅λλ€.
3.0a10μΌλ‘ λλ리면 λ¬Έμ κ° μ¬λΌμ§λλ€.
μμΆμ κ³Ό μ΄ μΆκ° μ 보μ κ°μ¬λ립λλ€. μ΄ λμΌν μΆ©λμ΄ #130μμ λ³΄κ³ λμμ΅λλ€. d2bc68561f96b3d8d523c751879429ead8e87894μμ μ΄ λ²κ·Έλ₯Ό λμ ν κ² κ°μ΅λλ€.
κ°μ λ¬Έμ κ° μμ΅λλ€.
λ€μμ μν μΈμ μ λλ€.
$ sudo supervisorctl -c conf/supervisord.conf reload
Restarted supervisord
$ sudo supervisorctl -c conf/supervisord.conf status
unix:///tmp/supervisord.sock no such file
μ λ μ΄ λ¬Έμ κ° μμ΅λλ€. reloadλ₯Ό νΈμΆν λ Supervisordκ° μΆ©λν©λλ€. 3.0a10μΌλ‘ λ€μ΄κ·Έλ μ΄λνλ μ μΌν μμ μ¬νμ λκΉ?
@landreville λ²κ·Έλ
μ΄ λ¬Έμ μ λν΄ +1
νμ¨μ λ΄μ¬λ κ²κ³Ό λμΌ
κ°λ
μ -n -u μ무λ -c ../conf/supervisor.ini --pid=/tmp/supervisor.pid
2012-12-17 16:08:20,208 CRIT uidλ₯Ό μ¬μ©μ 65534λ‘ μ€μ
2012-12-17 16:08:20,211 μ 보 κ΄λ¦¬μκ° PID 5016μΌλ‘ μμνμ΅λλ€.
2012-12-17 16:08:21,215 μμ±λ INFO: pid 5019κ° μλ 'celeryd'
2012-12-17 16:08:31,556 INFO μ±κ³΅: μ
λ¬λ¦¬κ° RUNNING μνμ λ€μ΄κ°κ³ νλ‘μΈμ€κ° 10μ΄ μ΄μ μ μ§λ¨(startsecs)
2012-12-17 16:08:34,444 WARNμ΄ λ€μ μμ μμ²μ λνλ΄λ SIGHUPμ μμ νμ΅λλ€.
2012-12-17 16:08:34,444 μ
λ¬λ¦¬λκ° μ£½κΈ°λ₯Ό κΈ°λ€λ¦¬λ INFO
2012-12-17 16:08:34,582 INFO μ€μ§λ¨: celeryd(μ’
λ£ μν 0)
μμΆμ (κ°μ₯ μ΅κ·Ό νΈμΆ λ§μ§λ§):
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/loggers.py", 81ν, λ°©μΆ
self.stream.write(msg)
ValueError: λ«ν νμΌμ λν I/O μμ
μμΆμ (κ°μ₯ μ΅κ·Ό νΈμΆ λ§μ§λ§):
νμΌ "/var/www/configtest/env/bin/supervisord", 8ν,
load_entry_point('κ°λ
μ==3.0b1', 'μ½μ_μ€ν¬λ¦½νΈ', 'κ°λ
μ')()
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/supervisord.py", 360ν, λ©μΈ
μ΄λ(μ΅μ
)
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/supervisord.py", 370ν, μ΄λ μ€
d.λ©μΈ()
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/supervisord.py", 77ν, λ©μΈ
info_messages)
make_loggerμ νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/options.py", 1274ν
self.logger.critical(msg)
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/loggers.py", 313ν, μ€μ
self.log(LevelsByName.CRIT, λ©μμ§, **kw)
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/loggers.py", 319ν, λ‘κ·Έ
handler.emit(κΈ°λ‘)
νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/loggers.py", 214ν, λ°©μΆ
self.doRollover()
doRolloverμμ νμΌ "/var/www/configtest/env/lib/python2.7/site-packages/supervisor/loggers.py", 223ν
κ·Έλ μ§ μμ κ²½μ°(self.stream.tell() >= self.maxBytes):
ValueError: λ«ν νμΌμ λν I/O μμ
25303d45eb75c980e97a5ea3eca307a464ad8e2bμμ μμ λμμ΅λλ€.
μ΄μ¨λ μ΄ μν©μμ 볡ꡬνλ €λ©΄?
ν λ¬ μ λ³΄λ€ μ΄μ λ²μ μ κ΅¬μ± νμΌμ λ¨μν λ€μ λ‘λνλ κ²μ΄ μ λ§ μ¬μ€μ λκΉ?
κ°λ μκ° μμ μ μ€λ¨ν μνλ‘ λλμ?
μ΄ λ¬Έμ λ λ‘κ·Έ νμ μ΅μ μ΄ νμ±νλ κ²½μ° 3.0b1 λ²μ μμλ§ λ°μν©λλ€. μ΄μ λ²μ μ μ¬μ© μ€μ΄κ±°λ λ‘κ·Έ νμ μ΅μ μ μ¬μ©νμ§ μλ κ²½μ° μν₯μ μ£Όμ§ μμ΅λλ€.
μ΄μ¨λ μ΄ μν©μμ 볡ꡬνλ €λ©΄?
λΆννκ²λ. Supervisordκ° μκΈ°μΉ μκ² μ’ λ£λλ©΄ ν΄λΉ νμ νλ‘μΈμ€κ° κ³ μκ° λ μ μμΌλ©° νλμ μ체μ μΌλ‘ κ³μ μ€νλ μ μμ΅λλ€. κ·Έλ¬λ Supervisordκ° λ€μ μμλκΈ° μ μ μ΄λ μμ μμ μλμΌλ‘ μ’ λ£ν΄μΌ ν©λλ€. μλ‘μ΄ Supervisord μΈμ€ν΄μ€κ° μμλλ©΄ λ€λ₯Έ μΈμ€ν΄μ€μ μν΄ λΆλ¦¬λμμ μ μλ νλ‘μΈμ€μ λν΄ μμ§ λͺ»ν©λλ€.
25303d4 μμ νλ‘κ·Έλ¨μ μ€μ λ‘ μ΄ λ¬Έμ λ₯Ό ν΄κ²°νμ§ λͺ»νμ΅λλ€. κ°μ μ€λ₯μ λλ€.
λ§μ§λ§ λκΈμ μ·¨μν©λλ€. μ΄μ λ§μ€ν°(3.0b2-dev)λ₯Ό μ¬μ©νμ¬ μμΌ μ€λ₯ μμ΄ λ€μ λ‘λν μ μμ΅λλ€. μ΅κ·Ό λ¬Έμ λ μνΌλ°μ΄μ κ° λ€μ λ‘λλ λ νλ‘μΈμ€κ° μμλμ§ μλ μλ‘μ΄ μνΌλ°μ΄μ ꡬμ±μΌλ‘ μΈν΄ λ°μν κ² κ°μ΅λλ€. κ·Έ κ²°κ³Ό λμΌν μ λμ€ μμΌ μ€λ₯κ° λ°μνμ¬ λλ₯Ό λ²λ Έμ§ λ§ νλ‘μΈμ€κ° μμ λλ©΄ λ€μλ‘λκ° μλνκΈ° μμνμ΅λλ€.
μ΄ λ²κ·Έλ μ¬μ ν μ‘΄μ¬ν©λλ€.
λ²κ·Έλ λμκ²λ μ‘΄μ¬ν©λλ€.
supervisorctl reload
λ‘κ·Έ νμΌμ λ€μκ³Ό κ°μ΄ λ§ν©λλ€.
2013-06-01 13:58:54,697 INFO waiting for memmon, celerydb, celerycam, gunicorn to die
2013-06-01 13:58:54,698 INFO stopped: celerycam (terminated by SIGTERM)
2013-06-01 13:58:54,868 INFO stopped: gunicorn (exit status 0)
2013-06-01 13:58:54,871 INFO stopped: celerydb (exit status 0)
2013-06-01 13:58:54,871 INFO stopped: memmon (terminated by SIGTERM)
(μΆκ° νλͺ© μμ)
κ°λ
μκ° virtualenvμ μ‘΄μ¬νκ³ λ²μ μ supervisor==3.0b2
νμ΄μ¬ 2.7.3
Supervisor==3.0b2μ μ¬μ ν μ‘΄μ¬ν©λλ€. μλ§λ λ€μ λμ λμμ κ²μ λλ€. κ΅¬μ± νμΌμ μ¬μ©μ μ μ μμΌκ³Ό κ΄λ ¨μ΄μμ μ μμ΅λλ€. μ€μ λ‘λ λͺ¨λ₯΄κ² μ΅λλ€.
μ°λ¦¬λ μ§κΈ μ½ 6κ°μ λμ supervisor==3.0b1
λ₯Ό μ¬μ©ν΄ μμΌλ©° μ΅κ·ΌμμΌ μ¬κΈ°μ μ€λͺ
λ λ¬Έμ μ μ§λ©΄νκΈ° μμνμ΅λλ€. νΉν, μ°λ¦¬λ ν¨λΈλ¦ νμΌλ‘ ꡬλλλ λΉλ/λ°°ν¬ λͺ©μ μΌλ‘ Jenkinsλ₯Ό μ¬μ©ν©λλ€. μμ μ κ°λ
μ λ‘κ·Έλ λ€μκ³Ό κ°μ΅λλ€.
2013-06-23 14:03:10,623 INFO daemonizing the supervisord process
2013-06-23 14:03:10,624 INFO supervisord started with pid 24211
2013-06-23 14:03:11,627 INFO spawned: 'websocket' with pid 24212
2013-06-23 14:03:11,628 WARN received SIGHUP indicating restart request
2013-06-23 14:03:11,628 INFO waiting for websocket to die
2013-06-23 14:03:15,051 INFO waiting for websocket to die
2013-06-23 14:03:18,674 INFO waiting for websocket to die
2013-06-23 14:03:21,678 WARN killing 'websocket' (24212) with SIGKILL
2013-06-23 14:03:21,678 INFO waiting for websocket to die
2013-06-23 14:03:21,685 INFO stopped: websocket (terminated by SIGKILL)
보μλ€μνΌ νλ‘μΈμ€λ₯Ό μ
λ§ννκ³ μμ±ν μ§ν κ°λ
μλ SIGHUP
λ°μ΅λλ€. SIGHUP
μ νΈκ° κ°λ
μ νλ‘μΈμ€λ‘ μ μ‘λλ μμΉκ° νμ€νμ§ μμ΅λλ€.
3.0.b2λ‘ ν΄κ²°λμλμ? μ¬κΈ° μ λ³κ²½ λ‘κ·Έλ μ΄λ₯Ό λνλ΄μ§ μμ΅λλ€.
μ λκΈμ λ²κ·Έκ° μλ κ² κ°μ΅λλ€. λκ°κ° κ°λ μμκ² SIGHUPμ 보λ΄κ³ κ°λ μκ° ν΄λΉ SIGHUPμ μ μμ μΌλ‘ μλ΅νλ κ²μ²λΌ λ€λ¦½λλ€. κ·Έ μ νΈλ₯Ό 보λ΄λ κ²μ΄ 무μμΈμ§ μμλ΄μΌ ν©λλ€. κ°λ μλ μμ μκ² μ νΈλ₯Ό 보λ΄μ§ μμ΅λλ€.
μ΄ νΉμ λ¬Έμ λ³΄κ³ μλ ν΅μ ν μ μλ€κ³ μκ°ν©λλ€. μ μ΄λ 4κ°μ§ λ€λ₯Έ λ¬Έμ κ° κ°μ λ¬Έμ μΈ κ²μ²λΌ λ³΄κ³ λ κ² κ°μ΅λλ€.
μλΉμ€λ₯Ό μμνμ¬ μ΄ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
sudo service supervisord start
μ΄ νμ λ€μμ μ€νν μ μμ΅λλ€.
sudo supervisorctl reload
@harph μ°¨λΌλ¦¬ 루νΈλ‘ μ€ννμ§ μμΌλ €κ³ ν©λλ€.
@aneumeier λ μ¬μ©μμκ² μ΄ μλΉμ€λ₯Ό μ¬μ©ν μ μλ κΆνμ ν λΉν©λλ€.
@ νν
κ·Έκ²μ λλ₯Ό μν΄ μΌνμ΅λλ€ - ν° κ°μ¬ν©λλ€!
@harph λμν μ μμ΅λλ€. μ¬μ©μκ° μλΉμ€λ₯Ό _μμ_ν μ μλλ°λ μλΉμ€λ₯Ό _λ€μ μμ_ν μ μλ μ΄μ λ 무μμ λκΉ?
@aneumeier λλ κ·Έλ° λ§μ νμ§ μμλ€. λ΄κ° λ§ν κ²μ λ€μ λ‘λνκΈ° μ μ μλΉμ€λ₯Ό μμν΄μΌ νλ€λ κ²μ λλ€. μμ μμ sudoλ₯Ό μ¬μ©νμ¬ μννμ§λ§ μ¬μ©μμκ² μ¬λ°λ₯Έ κΆνμ ν λΉνλ©΄ μλΉμ€λ₯Ό μμνκ³ λ€μ μμν μ μμ΅λλ€.
λλ₯Ό μν΄ sudo μλΉμ€ κ°λ μ μμμ΄ μ μλν©λλ€ :) Ubuntu 12.04 LTS
sudo μλΉμ€ μνΌλ°μ΄μ μμ
κ·Έκ²μ λν λλ₯Ό μν΄ μΌνμ΅λλ€ - λ§€μ° κ°μ¬ν©λλ€!
@νν +1
:+1:
μ€λ CentOS μ μ₯μμμ Supervisorλ₯Ό μ κ±°νκ³ easy_installμ μ¬μ©νμ¬ μ€μΉνμ΅λλ€. κ°λ
μλ κ·Έ μ΄λ λ보 λ€ λ μ μλν©λλ€. νμ§λ§ Supervisorctlμλ λ¬Έμ κ° μμ΅λλ€.
μ μκ² service supervisor start
μ루μ
μ΄ μλνμ§ μμ΅λλ€. λν service supervisor restart
μλν λ€μ μμ, μ€μ§, μμ... μΌκΈ° λ° λκΈ°. λ€μ μμ.. μ무κ²λ.
$ supervisorctl reload
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
$ supervisorctl restart foo
unix:///var/tmp/supervisor.sock no such file
CentOS λ¦΄λ¦¬μ€ 6.5(μ΅μ’ )μ Supervisor-3.1.1-py2.6
2014λ 8μ 18μΌ μ€ν 5μ Etay Cohen-Solalμ λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
μ€λ CentOS μ μ₯μμμ Supervisorλ₯Ό μ κ±°νκ³ λ€μμ μ¬μ©νμ¬ μ€μΉνμ΅λλ€.
easy_install. κ°λ μλ κ·Έ μ΄λ λ보 λ€ λ μ μλν©λλ€. κ·Έλ¬λ λλ λν κ°μ§κ³ μλ€
Supervisorctlμ λ¬Έμ κ° μμ΅λλ€.
Supervisorctlμ μ¬μ©μ μ§μ ꡬμ±μμ supervisord.confμ μ‘μΈμ€ν΄μΌ ν©λλ€.
Supervisorctlμ λ€μμμ supervisord.conf νμΌμ μ°Ύμ΅λλ€.
μμΉ(μμλλ‘):
etc/supervisord.conf
supervisord.conf
/etc/supervisord.conf
λ Έλ ₯νλ€:
Supervisorctl -c /κ²½λ‘/to/the/supervisorctl.conf
λλ₯Ό μν΄ |μλΉμ€ μνΌλ°μ΄μ μμ| μ루μ μ΄ μλνμ§ μμ΅λλ€. λν λ Έλ ₯
|μλΉμ€ κ°λ μ μ¬μμ| κ·Έλ° λ€μ μμ, μ€μ§, μμ... μΌκΈ° λ°
κΊΌμ§..μ¬μμ..μ무κ²λ.|$ supervisorctl λ€μ λ‘λ
μ€λ₯:, [μ€λ₯ λ²νΈ 2] ν΄λΉ νμΌ λλ λλ ν°λ¦¬κ° μμ΅λλ€: νμΌ: λΌμΈ: 1
$ supervisorctl myapp λ€μ μμ
unix:///var/tmp/supervisor.sock ν΄λΉ νμΌ μμ
|CentOS λ¦΄λ¦¬μ€ 6.5(μ΅μ’ )μ Supervisor-3.1.1-py2.6
β
μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ±°λ GitHubμμ νμΈνμΈμ.
https://github.com/Supervisor/supervisor/issues/121#issuecomment -52554399.
κ°μ¬ν©λλ€.
νμΌμ /etc/supervisord.confμ μμ΅λλ€.
[supervisord]
http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=debug ; (logging level;default info; others: debug,warn)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
user=root ; (default is current user, required if root)
[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL for a unix socket
username=root ; should be same as http_username if set
password=[mypassword] ; should be same as http_password if set
[include]
files = /var/www/websites/supervisor/*.conf
λͺ λ Ή μ€ν:
# supervisorctl -c /etc/supervisord.conf
unix:///var/tmp/supervisor.sock no such file
κ·Έλ¦¬κ³ νμΌμ μ€μ λ‘ κ±°κΈ°μ μμ΅λλ€. Supervisordκ° μλνκ³ λͺ¨λ λ°λͺ¬μ΄ μ¨λΌμΈ μνμ΄λ©° μλ μ€μ λλ€.
2014λ 8μ 18μΌ μ€ν 5μ 48λΆμ Etay Cohen-Solalμ λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
[ν¬ν¨νλ€]
νμΌ = /var/www/websites/supervisor/*.conf
|λͺ λ Ή μ€ν:
|# supervisorctl -c /etc/supervisord.conf
unix:///var/tmp/supervisor.sock ν΄λΉ νμΌ μμ
|κ·Έλ¦¬κ³ νμΌμ μ€μ λ‘ κ±°κΈ°μ μμ΅λλ€. Supervisord μμ λ° λͺ¨λ λ°λͺ¬
μ¨λΌμΈ μνμ΄λ©° μλ μ€μ λλ€.
κ·Έλ¬λ©΄ μ΄ κ΅¬μ± νμΌμ μ¬μ©νμ¬ Supervisordκ° μμλμ§ μμμ΅λλ€. λ
λμΌν λ°©μμΌλ‘ ν΄λΉ κ΅¬μ± νμΌλ‘ Supervisordλ₯Ό μμν μ μμ΅λλ€.
κ°λ μ -c /etc/supervisord.conf
μ΄κ±Έ λ©μΌλ¦¬μ€νΈμ μ¬λ €λμΌμ§..
μ΄κ²μ OPμ λ²κ·Έ λ³΄κ³ μμλ κ±°λ¦¬κ° λ©λ€.
λ κ°μ§ μ΄μ λ‘ λ‘λλ κ΅¬μ± νμΌμ΄μ΄μΌ ν©λλ€.
λ΄κ° κ°μ§κ³ μλ μ μΌν νμΌμ΄λ€.
locate supervisord.conf
/etc/supervisord.conf
/etc/supervisord.conf.backup
/etc/supervisord.conf.rpmsave
/var/www/websites/supervisor/*.conf
μ΄ μλνκ³ μμΌλ©° μ€λ μ΄ νμΌμμλ§ μ€μ νκΈ° λλ¬Έμ μ΄ ν΄λκ° λ€λ₯Έ κΈ°λ³Έ νμΌμ΄λ μ΄μ νμΌμ μ€μ λμ΄ μμ κ°λ₯μ±μ μμ΅λλ€.νμ§λ§ μ΄μ¨λ , λλ μλνλ€:
# service supervisord stop
Shutting down supervisord: [ OK ]
# supervisord -c /etc/supervisord.conf
# supervisorctl reload
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
# supervisorctl restart foo
unix:///var/tmp/supervisor.sock no such file
λ€μ κ°μ¬ν©λλ€. λ©μΌ λͺ©λ‘μ λ€μ κ²μνμκ² μ΅λκΉ? λ€λ₯Έ μ¬λλ€μ΄ μ¬κΈ°μ λ³΄κ³ ν μΌλΆ μ€λ₯μ μ μ¬νμ§λ§.
μλ κ²μλ¬Όκ³Ό μ ν κ΄λ ¨μ΄ μμΌλ―λ‘ κ·Έλ μ΅λλ€.
κ·Έλ¬λ μ΄μ¨λ , μ°λ¦¬λ κ·Έκ²μ μ¬κΈ°κΉμ§ μ€μΌμμΌ°μΌλ―λ‘ λ€μμ μλνμμμ€:
supervisord -c /etc/supervisord.conf
supervisorctl -c /etc/supervisord.conf reload
supervisorctl -c /etc/supervisord.conf restart foo
κ°μ¬ν©λλ€.
# supervisord -c /etc/supervisord.conf
# supervisorctl -c /etc/supervisord.conf reload
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
# supervisorctl -c /etc/supervisord.conf restart foo
unix:///var/tmp/supervisor.sock no such file
λλ λν supervisor.sockμ μ°ΎμΌλ €κ³ λ Έλ ₯νμ΅λλ€.
# updatedb
# locate supervisor.sock
#
ν΄λΉ νμΌμ΄ μμ΅λλ€.
2014λ 8μ 18μΌ μ€ν 6μ 9λΆμ Etay Cohen-Solalμ λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
κ°μ¬ν©λλ€.
|# κ°λ μ -c /etc/supervisord.conf
Supervisorctl -c /etc/supervisord.conf λ€μ λ‘λ
μ€λ₯:
, [μ€λ₯ λ²νΈ 2] ν΄λΉ νμΌ λλ λλ ν°λ¦¬κ° μμ΅λλ€: νμΌ: λΌμΈ: 1 Supervisorctl -c /etc/supervisord.conf foo μ¬μμ
unix:///var/tmp/supervisor.sock ν΄λΉ νμΌ μμ
λλ λν supervisor.sockμ μ°ΎμΌλ €κ³ λ Έλ ₯νμ΅λλ€.
μ€λ§λ¦¬ μμ. μ¬κΈ°μμ μ΄κ²μ λν μ΄μΌκΈ°λ νμ€ν κ·Έλ§λλλ‘ ν©μλ€. λλ μ μν κ²μ΄λ€
λ©μΌ λͺ©λ‘μΌλ‘ κ°μ Έκ°λλ€.
@ET-CSμ λμΌν λ¬Έμ κ° λ°μνμ΅λλ€.
μλ§ νμΌμ μ°Ύμ μ μμ΅λλ€
vagrantλ₯Ό μ¬μ©νμ¬ μ°λΆν¬ VM νμ
κ·Έλ¦¬κ³ μ¬μ©
sudo supervisord -c /vagrant/scripts/supervisord.conf
μμ κ²μλ κ²κ³Ό λμΌν μ€λ₯κ° λ°μν©λλ€. .. μλ§μ΄ μμ΅λλ€.
μ°λΆν¬ 14.04μ 3.0b2μ λν λμΌν λ¬Έμ , μ¬λΆν ν΄λ ν΄κ²°λμ§ μμ
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 224
μ΄μ λ₯Ό μ°Ύμμ΅λλ€.
stdout_logfile_maxbytes=100M
ν΄μΌνλ€
stdout_logfile_maxbytes=100MB
λΉμ·ν λ¬Έμ κ°μμμ΅λλ€.
λ΄ λ¬Έμ λ λ‘κ·Έ νμΌμ λν κ²½λ‘κ° μμ±λμ§ μμκ±°λ μ‘μΈμ€ν μ μλ€λ κ²μ
λλ€.
λλ κ°μ λ¬Έμ μ λΆλͺμ³€λ€. λλ Supervisordλ₯Ό μ£½μ΄κ³ κ·Έκ²μ μ¬μ©νμ¬ λ€μ μμνλ €κ³ μλνμ΅λλ€.
supervisord -c /path/to/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.
κ·Έλμ /var/runμμ κ°λ μ μμΌμ μμ νκ³ λ€μ μ€ννμ΅λλ€.
supervisord -c /path/to/supervisord.conf
ν¨κ³Όκ° μμλ€. λμμ΄ λμκΈ°λ₯Ό λ°λλλ€
@harph μνμ΄! κ·Έκ²μ λμκ² μ μ©ν©λλ€! κ°μ¬!
Supervisorctl -c /etc/supervisor/supervisord.confλ₯Ό μ€ννκΈ°λ§ νλ©΄ λ©λλ€.
Supervisorctlμ΄ κ΅¬μ± νμΌμ μ°Ύμ μ μμ΅λλ€
supervisord -n
μμΈν μ€λ₯ μ 보λ₯Ό μ°Ύλ λ° λμμ μ£Όμ
μ κ°μ¬ν©λλ€.
λλ μ»μλ€
unix:///var/run/supervisor.sock no such file
Supervisorctlμ μ‘μΈμ€νλ €κ³ ν λ μ€λ₯κ° λ°μνμ΅λλ€. μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ €λ©΄ κ°λ μ μλΉμ€κ° μ€ν μ€μΈμ§ νμΈν΄μΌ ν©λλ€.
sudo service supervisor status
κ·Έκ²μ΄ λΉμ μ λ¬Έμ μΈμ§ μλ €μ€ κ²μ λλ€. μ€νλκ³ μμ§ μλ€λ©΄ κ°λ¨ν μμνμμμ€.
sudo service supervisor start
Vagrant VMμμ κ°λ μλ₯Ό μ€νν λ μ΄λ€ μ΄μ λ‘ μλΉμ€κ° μλ μμλμ§ μμ μλ μλΉμ€ μμμ΄ νμνλ€λ κ²μ λ°κ²¬νμ΅λλ€.
Weesyλ₯Ό μ λ°μ΄νΈν λ΄ λΌμ¦λ² 리 νμ΄μμλ μ΄ μ€λ₯λ₯Ό λ°κ²¬νμ΅λλ€.
sudo supervisorctl reload
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 224
μμ μ½κΈ°:
sudo supervisord
Error: The directory named as part of the path /var/log/supervisor/supervisord.log does not exist.
Shichλ λ‘κΉ
λ¬Έμ λ₯Ό 보μ¬μ£Όμμ΅λλ€. μ€μ λ‘ λλ ν루 μ λ μ μ /var/log/μμ *λ₯Ό μ κ±°ν©λλ€.
λ€μ sudo supervisord
, λͺ¨λ μ’μ΅λλ€.
@JayH5 κ°μ¬ν©λλ€.
.sock νμΌμ μ°Ύμ μ μλ€λ λμΌν λ¬Έμ κ° μμμ΅λλ€. @mistermoes μ μμ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ λ° λμμ΄ λμμ΅λλ€.
$ sudo Supervisorctl λ€μ λ‘λ
μ€λ₯:
$ sodu κ°λ
μ μν
unix:///var/run/supervisor.sock ν΄λΉ νμΌ μμ
Supervisorctlμ λ€μ μμν ν μ΄ λ¬Έμ κ° ν΄κ²°λμμ΅λλ€!
λ³ν
[κ°λ
κ΄]
;;;;;;http_port=/var/tmp/supervisor.sock ; (κΈ°λ³Έκ°μ UNIX λλ©μΈ μμΌ μλ²λ₯Ό μ€ννλ κ²μ
λλ€)
http_port=127.0.0.1:9001 ; (λλ ip_address:portλ AF_INETμ μ§μ ν©λλ€)
μκ²
[κ°λ
κ΄]
http_port=/var/tmp/supervisor.sock ; (κΈ°λ³Έκ°μ UNIX λλ©μΈ μμΌ μλ²λ₯Ό μ€ννλ κ²μ
λλ€)
;;;;;;http_port=127.0.0.1:9001 ; (λλ ip_address:portλ AF_INETμ μ§μ ν©λλ€)
λ΄ λ¬Έμ λ₯Ό ν΄κ²°
μ¬μ ν λ¬Έμ κ° μλ κ²½μ°:
/etc/supervisord.confμ νμΌμ λ§λ€κ³ λ€μ μ½λλ₯Ό μΆκ°ν©λλ€.
(μ°Έκ³ λ‘ μ¬μ©μ μ΄λ¦μ κ·Έμ λ°λΌ λ³κ²½νμμμ€)
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown= mywebsiteuser:mywebsiteusergroup
[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = false
minfds = 1024
minprocs = 200
umask = 022
user = mywebsiteuser
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
strip_ansi = false
[supervisorctl]
##serverurl = unix:///tmp/supervisor.sock
serverurl = http://localhost:9001
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/mywebsiteuser/public_html/artisan queue:work database --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=mywebsiteuser
numprocs=8
redirect_stderr=true
stdout_logfile=/home/mywebsiteuser/worker.log
μ μ₯νκ³ νΈμ§κΈ°λ₯Ό μ’ λ£ν©λλ€.
κΈ°μ‘΄ κ°λ νλ‘μΈμ€λ₯Ό μ°Ύμ μ’ λ£
pgrep -fl supervisord
λ€μ λͺ λ Ήμ μ€ννλ©΄ μμ μκ° μ€νλμ΄μΌ ν©λλ€.
supervisord -c /etc/supervisord.conf
supervisorctl -c /etc/supervisord.conf reload
supervisorctl -c /etc/supervisord.conf start laravel-worker:*
@omsobliga κ°μ¬
μλ
μλ€μ!
μ΄λ° λ¬Έμ κ° μμ΅λλ€.
https://serversforhackers.com/monitoring-processes-with-supervisord λ§ν¬λ₯Ό λ°λΌκ°μ§λ§ "supervisorctl reread" λͺ
λ Ήμ μ€ννλ©΄ μ΄ λ©μμ§κ° λνλ©λλ€.
"μ€λ₯:
μ νν 무μμ μλ―Έν©λκΉ?
κ°μ¬ν©λλ€.
κΌλκ°μλ₯Ό μ¬μ©νμ¬ μ΄ λ¬Έμ κ° λ°μν¨
Error: /Stage[main]/Supervisor/Service[supervisor]: Failed to call refresh: Could not restart Service[supervisor]: Execution of 'supervisorctl reload' returned 2: error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 224
Error: /Stage[main]/Supervisor/Service[supervisor]: Could not restart Service[supervisor]: Execution of 'supervisorctl reload' returned 2: error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 224
No such file or directory
μ΄ λ¬Έμ μ κ΄λ ¨μ΄ μμ΅λκΉ?
ν΄κ²°μ± μ
supervisorctl
λ Supervisord λ°λͺ¬κ³Ό ν΅μ ν©λλ€. λ°λͺ¬μ΄ μ‘΄μ¬νμ§ μμΌλ©΄ μ΄ λꡬλ μ무 κ²λ μ§μν μ μμ΅λλ€. μ°κ²°μ μλν λ μμΌ νμΌμ μ°Ύμ μ μμ΅λλ€.
μ΄κ²μ μΌλΆ ꡬν μλ²μμ λλλ‘ μ°λ¦¬λ₯Ό κ΄΄λ‘νλ λ¬Έμ μμ΅λλ€. rhel/centosμ κ²½μ° μ΄ λ²κ·Έ λ³΄κ³ μλ₯Ό νμΈνμμμ€. κ°λ¨ν λ§ν΄μ κ°λ
μ 3.0-1.el7
릴리μ€λ μλ§ νμΌμ /var/tmp/supervisor.sock
μ λ°°μΉνκ³ 30μΌ νμ μ 리λ©λλ€. μ΄κ²μ΄ μ°λ¦¬μκ² λ¬Έμ κ° κ°νμ μΌλ‘ λνλ μ΄μ μ
λλ€. 3.1.3
릴리μ€μμ μ΄ μ»€λ° μΌλ‘ μμ λμμ΅λλ€.
@harph κ°μ¬ν©λλ€!
sudo service supervisord start
μ μλν©λλ€!
μ΄ λκΈ μ μ μκ² λ§μ λμ @efusionsoft , κ°μ¬ν©λλ€.
κ·Έλ¬λ κ·νμ μ루μ
μ λν λͺ κ°μ§ κ°μ μ¬νμ΄ μμ΅λλ€.
1) efusionsoftμ ꡬμ±μΌλ‘ κ°λ
μλ₯Ό μμνλ©΄ μ€λ₯κ° λ°μν©λλ€.
Please check that the [rpcinterface:supervisor] section is enabled in the configuration file (see sample.conf).
λμΌν μ€λ₯κ° λ°μνλ©΄ [supervisor] μΉμ λ€μ λ€μ μ½λλ₯Ό μΆκ°νμΈμ.
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
2) serverurl = http://localhost :9001μ΄ μλνμ§ μμΌλ©° μ΄μ λ₯Ό λͺ¨λ₯΄κ² μ΅λλ€. λ€νν serverurl = unix:///tmp/supervisor.sockμ΄ μ μλν©λλ€.
λ€μμ λ΄ /etc/supervisord.confμ μ 체 λ²μ μ λλ€.
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown = mywebsiteuser:mywebsiteusergroup
[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = false
minfds = 1024
minprocs = 200
umask = 022
user = mywebsiteuser
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
strip_ansi = false
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock
##serverurl = http://127.0.0.1:9001
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php/home/mywebsiteuser/public_html/artisan queue:work database --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=mywebsiteuser
numprocs=1
redirect_stderr=true
stdout_logfile=/home/mywebsiteuser/worker.log
ꡬμ±μ μ μ₯ν ν:
1) μ€ν μ€μΈ λͺ¨λ κ°λ
μ μΈμ€ν΄μ€λ₯Ό μ°Ύμ΅λλ€.
pgrep -fl supervisord
2) μ€ν μ€μΈ λͺ¨λ μνΌλ°μ΄μ νλ‘μΈμ€λ₯Ό μ’
λ£ν©λλ€.
sudo kill {your process PID}
3) μλ‘μ΄ κ΅¬μ±μΌλ‘ κ°λ
μ μμ:
supervisord -c /etc/supervisord.conf
4) κ°λ
μ μν νμΈ
supervisorctl -c /etc/supervisord.conf status
5) μ¦κΈ°μΈμ!
μ΄κ²μ λλ₯Ό μν΄ μΌνμ΅λλ€.
sudo systemctl start supervisor
sudo systemctl enable supervisor
sudo supervisorctl reload
λ€μ λμ Supervisordκ° μ€νλκ³ μμ§ μλ€λ μ μ ν μ€λ₯ λ©μμ§λ₯Ό μΆκ°νμ§ μλ μ΄μ λ λ€μκ³Ό κ°μ΅λλ€.
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224
λ΄ λ¬Έμ λ μμ μμ λ‘κ·Έ λλ ν λ¦¬κ° @YAmikep μ²λΌ μ‘΄μ¬νμ§ μλλ€λ κ²μ λλ€. λλ ν 리λ₯Ό μμ±νλ©΄ λ¬Έμ κ° ν΄κ²°λμκ³ κ°λ μλ μμ μλ₯Ό μ±κ³΅μ μΌλ‘ μμνκ³ μμνμ΅λλ€.
μ΄κ²μ΄ RHELμμ unix:///tmp/supervisor.sock no such file
λ¬Έμ λ₯Ό ν΄κ²°ν λ°©λ²μ
λλ€.
ps -ef | grep supervisord # get supervisord PID
kill -s SIGTERM 1234 # where 1234 is the PID
ps -ef | grep supervisord # check that supervisord is killed
supervisord # restart the daemon
λλ κ°μ λ¬Έμ κ° μμκ³ supervisord
μ€νν ν λ‘κ·Έμ κ°λ
μκ° μμνλ €κ³ νλ μ΄μ μλΉμ€μμ λ¬Έμ κ° λ°μνμμ 보μ¬μ£Όμμ§λ§ μκ° μ μ ν΄λΉ νλ‘κ·Έλ¨ ν΄λλ₯Ό μμ νμ§λ§ κ°λ
μ conf.dμμλ μμ νμ§ μμμ΅λλ€. / ν΄λ. κ·Έλμ μ‘΄μ¬νμ§ μλ νλ‘κ·Έλ¨μ μμνλ €κ³ ν΄μ λ¬Έμ κ° λ°μνμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
μλΉμ€λ₯Ό μμνμ¬ μ΄ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
μ΄ νμ λ€μμ μ€νν μ μμ΅λλ€.