Friday 7 August 2015

Supervisord & Rundeck

supervisord

install

$ sudo easy_install supervisor

generate SHA-1 hash of password to be used for TCP access

$ echo -n password | sha1sum | awk '{print $1}'

enable TCP access

sudo vim /etc/supervisor/supervisord.conf

[inet_http_server]
port = 127.0.0.1:9001
username = user
password = {SHA}1235678

configure supervisorctl command line access (note password cannot be SHA hash, has to be plaintext)

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
serverurl=http://localhost:9001
username = user
password = abcdef

add a program

sudo vim /etc/supervisor/conf.d/app_example.conf

[program:app_example]
command=app_example
directory=/path/to/app
autostart:false
autorestart:false
startsecs:5
startretries:3
user:prod
redirect_stderr:true
stdout_logfile:/path/to/app/logfile.log
stdout_logfile_maxbytes:1000GB

supervisorctl - enter interactive mode

supervisorctl -s http://localhost:9001 -u user -p password

start/stop

    supervisorctl -s http://localhost:9001 -u user -p password start group:app

reread/restart/update

supervisorctl -s http://localhost:9001 -u user -p password update (or reread, restart)

reread just reads config changes, but doesn’t restart any affected processes
restart restarts the names process without loading any config changes
update rereads and restarts apps with changed configuration

rundeck

download and install from http://rundeck.org/downloads.html

add user to rundeck group

$ sudo usermod -a -G rundeck steve

add write permissions to rundeck group

$ sudo chmod g+w -R /var/rundeck

No comments:

Post a Comment