Skip to content

Instantly share code, notes, and snippets.

@rhelmer
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhelmer/7600987403fe5d3b2db5 to your computer and use it in GitHub Desktop.
Save rhelmer/7600987403fe5d3b2db5 to your computer and use it in GitHub Desktop.
socorro+envconsul
. 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