Skip to content

Instantly share code, notes, and snippets.

@pavan538
Last active January 3, 2019 07:01
Show Gist options
  • Save pavan538/08199badee3fafcda7336eb50b2485cc to your computer and use it in GitHub Desktop.
Save pavan538/08199badee3fafcda7336eb50b2485cc to your computer and use it in GitHub Desktop.
supervisor - mange processes
Install supervisor python3
pip3 install git+https://github.com/Supervisor/supervisor
[supervisord]
nodaemon=false
[supervisorctl]
[inet_http_server]
port = 127.0.0.1:9001
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:influxdb]
autostart = true
autorestart = true
command = /usr/bin/influxd -config /etc/influxdb/influxdb.conf
startretries = 3
user = root
[program:jupyter]
command = /home/ubuntu/virtual_envs/kaggle/bin/jupyter notebook --no-browser --config=/home/ubuntu/.jupyter/jupyter_notebook_config.py
environment=PATH="/home/ubuntu/virtual_envs/kaggle/bin:%(ENV_PATH)s"
directory = /home/ubuntu/ml
user = ubuntu
autostart = true
autorestart = true
redirect_stderr = true
[program:zookeeper]
autostart = true
autorestart = true
command = /home/pavan/softwares/kafka_2.11-0.11.0.1/bin/zookeeper-server-start.sh /home/pavan/softwares/kafka_2.11-0.11.0.1/config/zookeeper.properties
startretries = 3
user = pavan
[program:kafka]
autostart = true
autorestart = true
command = /home/pavan/softwares/kafka_2.11-0.11.0.1/bin/kafka-server-start.sh /home/pavan/softwares/kafka_2.11-0.11.0.1/config/server.properties
startretries = 3
user = pavan
restart the supervisor :
/etc/init.d/supervisor restart
if you add new service to existing conf file.
# sudo supervisorctl
# supervisor>update
# supervisor>start servicename
you can also use stop, start , ps commands in supervisor
# Web interface for supervisor.
Inside of /etc/supervisord.conf, add this:
[inet_http_server]
port = 9001
username = user # Basic auth username
password = pass # Basic auth password
http://localhost:9091
## to set environment
environment=JMX_PORT=7777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment