Supervisor deploys go gin service or deploys independently under Linux

Supervisor deployment method

supervisord installation

 sh setuptools-0.6c11-py2.7.egg
 easy_install supervisor
 echo_supervisord_conf >/etc/supervisord.conf
 mkdir /etc/supervisord.conf.d

Modify the configuration /etc/supervisord.conf

 files = /etc/supervisord.conf.d/*.conf

New management application

 cd /etc/supervisord.conf.d
 vim idphoto_server_lite_supervisor.conf

Configuration file:

command execute command
directory cd to the specified directory
environment environment variable configuration
command = ./main
directory = /data2/yingjie/go/idphoto_server_lite
autostart = true
autorestart = true
startretries=10 ; maximum number of retries when startup fails
startsecs = 5
user = root
redirect_stderr = true
stopsignal=QUIT ; signal used to kill process (default TERM)
stopwaitsecs=2 ; max num secs to wait b4 SIGKILL (default 10)
stopasgroup=true ; send stop signal to the UNIX process group (default false)
killasgroup=true ; SIGKILL the UNIX process group (def false)
stdout_logfile = /data2/yingjie/go/idphoto_server_lite/super_log/idphoto_server_lite_supervisor.log

Leave a Reply

Your email address will not be published. Required fields are marked *