Run a three nodes Consul cluster, a couple of frontend nodes and one backend node.
Services provided:
- Consul Service Discovery
- cAdvisor
- nginx (as a reverse proxy)
- Custom app
- Bottle app
- Redis
- Wordpress
- PHP Built-in web server
- MySQL
- Clone this repository
- Execute
vagrant upto start the six nodes - SSH in every node
vagrant ssh ${HOSTNAME} - From "/home/vagrant/${HOSTNAME}" execute
sudo fig upto start every container - Modify your local "/etc/hosts"
sudo -- sh -c "echo 172.16.10.14 app.example.com wordpress.example.com >> /etc/hosts"
You'll find the following things at:
- Consul Console: http://172.16.10.11:8500
- cAdvisor: http://${NODE_IP}:8080
- Custom app: http://172.16.10.14:5000, http://172.16.10.15:5000
- Wordpress: http://172.16.10.15:8000
- Custom app through nginx: http://app.example.com
- Wordpress through nginx: http://wordpress.example.com
The nginx container in frontend-01 will fail if it starts before both the "web" and "wordpress" services (containers) are registered in Consul.
If this happens, please check both containers are running and rerun again the nginx container from "frontend-01:/home/vagrant/frontend-01":
sudo fig up nginx