2013-09-05 8 views
8

나는 다음과 같은 문제가 있습니다Supervisord은 1 예를 생성합니다

나는 Gearman을 노동자로 PHP 스크립트를 실행하려면, 또는 5로 노동자들이 정확하게 할 수 있습니다. 이것은 내 supervisord.conf-추가이다 : 나는 그것을 시작하면

[program:gearman-test-worker] 
process_name=%(program_name)s_%(process_num)02d 
command=/usr/bin/php /path/to/gearman-jobs/worker.php 
numprocs=5 
directory=/path/to/gearman-jobs/ 
stdout_logfile=/var/log/gearman-job-server/supervisord.log 
environment=GEARMAN_USER=gearman 
autostart=true 
autorestart=true 
user=gearman 
stopsignal=KILL 

supervisord -n (또는 데몬 모드에서)에만 메시지가 보일 것 대신 5의 1 예를 생성합니다 미세

[[email protected] gearman-jobs]# supervisord -n 
2013-09-03 14:24:58,775 CRIT Supervisor running as root (no user in config file) 
2013-09-03 14:24:58,789 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Tue Sep 3 14:24:58 2013 
     Hostname: <unix domain socket> 
     Port:/var/tmp/supervisor.sock 
2013-09-03 14:24:58,850 CRIT Running without any HTTP authentication checking 
2013-09-03 14:24:58,850 INFO supervisord started with pid 8722 
2013-09-03 14:24:58,853 INFO spawned: 'gearman-test-worker' with pid 8723 
2013-09-03 14:24:59,858 INFO success: gearman-test-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 

및 단일 인스턴스를 생성하는 이유는 없습니다. 도울 수 있니?

+0

그런데 5 개의 프로그램 하위 섹션을 만들고 numprocs 매개 변수를 제거하면 근로자가 올바르게 양산됩니다. –

답변

9

나는 문제가 아주 간단하다고 생각합니다. "numprocs"구성 항목은 v3.0에서만 도입되었습니다 (http://supervisord.org/configuration.html 참조).

릴리스의 측면에서 크게 뒤떨어져있는 재고 CentOS 6.x 시스템에서 문제점을 복제 할 수있었습니다. 예상대로

# supervisord -n 
2013-09-14 17:19:52,708 CRIT Supervisor running as root (no user in config file) 
2013-09-14 17:19:52,724 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Sat Sep 14 17:19:52 2013 
    Hostname: <unix domain socket> 
    Port:/var/tmp/supervisor.sock 
2013-09-14 17:19:52,809 CRIT Running without any HTTP authentication checking 
2013-09-14 17:19:52,809 INFO supervisord started with pid 21521 
2013-09-14 17:19:52,817 INFO spawned: 'gearman-test-worker' with pid 21522 
2013-09-14 17:19:53,820 INFO success: gearman-test-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 

# rpm -qa | grep supervisor 
supervisor-2.1-8.el6.noarch 

# uname -a 
Linux dev26.sumilux.com 2.6.32-279.5.1.el6.i686 #1 SMP Tue Aug 14 21:14:52 UTC 2012 i686 i686 i386 GNU/Linux 

내가 3.X하기 위해 관리자 패키지를 업그레이드하는 경우

가 (실제로 고대 페도라 시스템에 이상 전환), 모든 작품 (I 5의 3 명 노동자 대신에 설정).

# supervisord -n 
2013-09-14 17:24:56,205 CRIT Supervisor running as root (no user in config file) 
2013-09-14 17:24:56,251 INFO RPC interface 'supervisor' initialized 
2013-09-14 17:24:56,252 CRIT Server 'unix_http_server' running without any HTTP authentication checking 
2013-09-14 17:24:56,252 INFO supervisord started with pid 20889 
2013-09-14 17:24:57,258 INFO spawned: 'gearman-test-worker_00' with pid 20890 
2013-09-14 17:24:57,263 INFO spawned: 'gearman-test-worker_01' with pid 20891 
2013-09-14 17:24:57,269 INFO spawned: 'gearman-test-worker_02' with pid 20892 
2013-09-14 17:24:58,271 INFO success: gearman-test-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 
2013-09-14 17:24:58,271 INFO success: gearman-test-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 
2013-09-14 17:24:58,272 INFO success: gearman-test-worker_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 

# rpm -qa | grep supervisor 
supervisor-3.0-0.5.a10.fc14.noarch 
+0

감사합니다! 나는 심지어 버전 번호를 보지는 않았다. 지금은 5 개의 하위 섹션 만 사용하겠습니다. –