Reference: http://blog.csdn.net/wawa8899/article/details/52743861
Reference: http://www.cnblogs.com/mountaingeek/p/5911291.html
Reference: http://www.linuxyw.com/718.html
Reference: http://www.iitshare.com/supervisord-manage-process.html
Reference: Http://stackoverflow.com/questions/20346851/running-celery-as-root
Run the build configuration file:
[Email protected]/]# echo_supervisord_conf >/etc/supervisord.conf ...pkg_resources. Distributionnotfound:meld3>=0.6. 5 Find Supervisor-3.3. 1-py2. 7. egg-Info0.6. 5 comment out and then execute
Configuration
[Program:dopcelerybeat]command=python manage.py celery beatnumprocs=1Directory=/data1/vhosts/dop.leju.com/autostart=trueStartsecs=Tenstartretries=3Stopwaitsecs= -Killasgroup=trueUser=Rootredirect_stderr=trueStdout_logfile=/data1/logs/supervisord-celery-Beat.logstderr_logfile=/data1/logs/supervisord-celery-beat-Error.log[program:dopceleryworker]command=python manage.py Celery Worker-lInfoNumprocs=1Directory=/data1/vhosts/dop.leju.com/autostart=trueStartsecs=Tenstartretries=3Stopwaitsecs= -Killasgroup=trueUser=Rootredirect_stderr=trueStdout_logfile=/data1/logs/supervisord-celery-Worker.logstderr_logfile=/data1/logs/supervisord-celery-worker-Error.log[group:dopcelery]programs=Dopcelerybeat,dopceleryworker;=999; The relative start priority (default999)
How to run the celery times wrong solution:
1st Solution-manually type command at terminal$ export C_force_root='true'2nd Solution-Edit Shell configuration$VI~/. BASHRC # Add following line export C_force_root='true'$ source~/. bashrc3rd Solution-Edit manage.py of Djangoimport osif__name__ = ='__main__': Os.environ.setdefault ('C_force_root','true') Os.environ.setdefault ('Django_settings_module','{PATH to SETTINGS FILE}') Execute_from_command_line (SYS.ARGV)
Command Supervisorctl can use Start/stop/status to manage each process
[Email protected] supervisor-3.3.1-py2.7. egg-Info]# supervisorctl dopcelery:dopcelerybeat STOPPED Dec the Geneva: +pmdopcelery:dopceleryworker RUNNING pid31136,Uptime 0: -: -Supervisor>status Dopcelery:dopcelerybeatdopcelery:dopcelerybeat STOPPED Dec the Geneva: +Pmsupervisor>
"Python" Supervisor installation and management celery