Created
October 30, 2013 20:54
-
-
Save jtriley/7240056 to your computer and use it in GitHub Desktop.
Supervisor (https://pypi.python.org/pypi/supervisor) config for StarCluster's loadbalancer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/tmp/supervisor.sock | |
[supervisord] | |
logfile=/tmp/supervisord.log | |
logfile_maxbytes=50MB | |
logfile_backups=10 | |
loglevel=info | |
pidfile=/tmp/supervisord.pid | |
nodaemon=false | |
minfds=1024 | |
minprocs=200 | |
[rpcinterface:supervisor] | |
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | |
[supervisorctl] | |
serverurl=unix:///tmp/supervisor.sock | |
[program:loadbalancer] | |
command=starcluster loadbalance mycluster -m 20 -n 1 -w 60 -a 20 -s 60 -i 60 -k 50 | |
autorestart=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this config you first need to install supervisor:
$ pip install supervisor
Then launch supervisord with the above config file:
$ supervisord -c /path/to/starcluster_loadbalance_supervisor.conf
This will launch the loadbalancer and continuously monitor it to make sure it's always up. The above supervisor config will relaunch the loadbalancer if it crashes for any reason.
Once the loadbalancer is running under supervisor you can monitor and control it using the
supervisorctl
command:This drops you into a supervisor prompt that supports a number of commands:
To monitor the loadbalancer status:
To monitor the loadbalancer output:
supervisor> tail -f loadbalancer
To restart the loadbalancer:
supervisor> restart loadbalancer
To stop the loadbalancer:
supervisor> stop loadbalancer
To see help info and usage for the other
supervisorctl
commands typehelp
followed by the command: