Last active
August 29, 2015 14:13
-
-
Save rhelmer/7600987403fe5d3b2db5 to your computer and use it in GitHub Desktop.
socorro+envconsul
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
. socorro-virtualenv/bin/activate | |
# "-bootstrap-expect 1" because there's only one consul server | |
consul agent -bootstrap-expect 1 -server -data-dir=./consul-data/ | |
# socorro/collector is the consul prefix, "socorro collector" runs collector | |
envconsul -upcase=false socorro/collector socorro collector | |
# when you change this key, envconsul restarts collector w/ new port | |
curl -X PUT -d '12345' http://localhost:8500/v1/kv/socorro/collector/web_server__port | |
# for production, use uwsgi | |
curl -X PUT -d 'socorro.webapi.servers.ApacheModWSGI' http://localhost:8500/v1/kv/socorro/collector/web_server__wsgi_server_class | |
# note, specifying "-once" because we don't want automatic restarts on this service | |
envconsul -once -upcase=false -prefix socorro/collector \ | |
uwsgi -H $VENV -w wsgi.collector -s /var/run/uwsgi/collector.wsgi | |
# see http://uwsgi-docs.readthedocs.org/en/latest/Nginx.html to connect nginx to this socket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment