Created
June 6, 2014 09:50
-
-
Save ponimas/8cd5159059d18b470e7c to your computer and use it in GitHub Desktop.
mongodb replica set + supervisord dev setup
This file contains hidden or 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
#!/usr/bin/env sh | |
sudo rm -rf $PWD/devenvs/*/db/* | |
sudo rm -rf $PWD/devenvs/*/mongodb.conf | |
sudo rm -rf $PWD/devenvs/*/supervisord.conf | |
sudo ln $PWD/devenvs/mongodb.conf $PWD/devenvs/n1/ | |
sudo ln $PWD/devenvs/mongodb.conf $PWD/devenvs/n2/ | |
sudo ln $PWD/devenvs/mongodb.conf $PWD/devenvs/n3/ | |
sudo ln $PWD/devenvs/mongodb.conf $PWD/devenvs/n4/ | |
sudo ln $PWD/devenvs/supervisord.conf $PWD/devenvs/n1/ | |
sudo ln $PWD/devenvs/supervisord.conf $PWD/devenvs/n2/ | |
sudo ln $PWD/devenvs/supervisord.conf $PWD/devenvs/n3/ | |
sudo ln $PWD/devenvs/supervisord.conf $PWD/devenvs/n4/ | |
docker run -d -v $PWD/devenvs/n1:/data -v $PWD/playground:/data/playground --name dev1 newzmq supervisord | |
docker run -d -v $PWD/devenvs/n2:/data -v $PWD/playground:/data/playground --name dev2 newzmq supervisord | |
docker run -d -v $PWD/devenvs/n3:/data -v $PWD/playground:/data/playground --name dev3 newzmq supervisord | |
docker run -d -v $PWD/devenvs/n4:/data -v $PWD/playground:/data/playground --name dev4 newzmq supervisord |
This file contains hidden or 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
systemLog: | |
destination: file | |
path: "/data/mongod.log" | |
quiet: true | |
logAppend: false | |
storage: | |
journal: | |
enabled: false | |
preallocDataFiles: false | |
smallFiles: true | |
replication: | |
oplogSizeMB: 100 | |
replSetName: transreplica | |
This file contains hidden or 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=/data/supervisor.sock ; (the path to the socket file) | |
[supervisord] | |
logfile=/data/logs/supervisord.log ; (main log file;default $CWD/supervisord.log) | |
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) | |
logfile_backups=10 ; (num of main logfile rotation backups;default 10) | |
loglevel=debug ; (log level;default info; others: debug,warn,trace) | |
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) | |
nodaemon=false ; (start in foreground if true;default false) | |
minfds=1024 ; (min. avail startup file descriptors;default 1024) | |
minprocs=200 ; (min. avail process descriptors;default 200) | |
nodaemon=true | |
[rpcinterface:supervisor] | |
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | |
[supervisorctl] | |
serverurl=unix:///data/supervisor.sock ; use a unix:// URL for a unix socket | |
[program:mongodb] | |
command=mongod -f /data/mongodb.conf | |
[program:http] | |
command=/python/bin/uwsgi --chdir /data/playground --pp /data/playground --disable-logging --http-socket :5001 -M --wsgi-file httpexpose.py --callable app --gevent 20 --py-autoreload=2 | |
user=root | |
directory=/data/playground | |
; requires supervisor-stdout | |
stdout_events_enabled=true | |
stderr_events_enabled=true | |
[program:pimp] | |
command=/python/bin/python pimp.py | |
directory=/data/playground | |
; requires supervisor-stdout | |
[eventlistener:stdout] | |
command = supervisor_stdout | |
buffer_size = 100 | |
events = PROCESS_LOG | |
result_handler = supervisor_stdout:event_handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment