Code Monkey home page Code Monkey logo

consul-nginx's Introduction

Consul Nginx

This Docker container is setup to run Nginx with Consul for service discovery and health monitoring.

It has also been optimized to run on Joyent's Triton, however it will always also support strait Docker and boot2docker.

Running

It can be run on its own simply via:

docker run -d  -p 8400 -p 8500 -p 8600 --name consul progrium/consul -server -bootstrap -ui-dir /ui
docker run -d --name lb1 --link consul:consul corbinu/consul-nginx

docker exec -it lb1 nginx-bootstrap

Consul will UI will be available on port mapped to 8500

Consul notes

Bootstrapping, Consul clusters, and the details about adding and removing nodes. The CLI and HTTP API are also documented.

Check for registered instances of a named service

curl -v http://consul:8500/v1/catalog/service/nginx | json -aH ServiceAddress

Register an instance of a service

export MYIP=$(ip addr show eth0 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
curl http://consul:8500/v1/agent/service/register -d "$(printf '{"ID": "nginx-%s","Name": "nginx","Address": "%s"}' $MYIP $MYIP)"

consul-nginx's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.