awerebea / infra-challenge

The infra-challenge training repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The infra-challenge app high availablity deployment

The complete task can be found here.

Architecture solution

The HA environment for the application mentioned above consist of 4 virtual machines. First one for reverse proxy (entry point), other three for the application itself.

Requirements

Usage

To launch deploy process in the root of this repository run:

$ vagrant up

Once the deployment is complete, you can determine the public IP address assigned to the web server:

$ echo $(vagrant ssh nginx -c "ip address show eth2 | grep 'inet ' |
sed -e 's/^.*inet //' -e 's/\/.*$//'")

show_ip
Also you can use the hardcoded private IP 10.2.2.100 to access the webserver.

Now you can try some tests.

Unsupported URI:

$ curl -v -GET http://192.168.1.231

page_not_found
Supported URI:

$ curl -v -GET http://192.168.1.231/ping

pong
After that, you can stop one of the nodes and repeat the test:

$ vagrant halt node1

$ vagrant global-status

$ curl -v -GET http://192.168.1.231/ping

stopped_one_node
Try to stop the second one and repeat the test again:

$ vagrant halt node2

$ vagrant global-status

$ curl -v -GET http://192.168.1.231/ping

stopped_two_nodes
Finally stop the last one and check:

$ vagrant halt node3

$ vagrant global-status

$ curl -v -GET http://192.168.1.231/ping

stopped_all_nodes
Now you can launch some nodes again and try to test one more time:

$ vagrant up node2 node3

$ vagrant global-status

$ curl -v -GET http://192.168.1.231/ping

launch_nodes_again

About

The infra-challenge training repo