2013-09-05 4 views
8

मैं निम्नलिखित समस्या है:Supervisord केवल 1 उदाहरण spawns

मैं एक 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 के लिए (वास्तव में एक प्राचीन फेडोरा सिस्टम पर स्विच करने से), सब कुछ उम्मीद के रूप में काम करता है (मैं 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 उपखंडों का उपयोग करूंगा। –

संबंधित मुद्दे