You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/lamp_haproxy/README.md

41 lines
1.9 KiB

11 years ago
Lamp Stack + load balancer(haproxy) + add/remove nodes from cluster + Serial Rolling update of webserserver
11 years ago
----------------------------------------------------------------------------------------------------------
This example is an extension of the simple lamp deployment, In this example we deploy a lampstack with a LoadBalancer in front.
11 years ago
This also has the capability to add/remove nodes from the deployment. It also includes examples to do a rolling update of a stack
11 years ago
without affecting the service.
11 years ago
***Setup Entire Site.
11 years ago
Firstly we setup the entire stack, configure the 'hosts' inventory file to include the names of your hosts on which the stack would be deployed.
[webservers]
web3
web2
[dbservers]
web3
[lbservers]
11 years ago
lbserver
After which we execute the following command to deploy the site.
11 years ago
ansible-playbook -i hosts site.yml
11 years ago
The deployment can be verified by accessing the webpage." lynx http://<ip-of-lb>:8888. multiple access should land you up in different webservers.
11 years ago
11 years ago
***Remove a node from the cluster.
11 years ago
Removal of a node from the cluster would be as simple as executing the following command:
11 years ago
ansible-playbook -i hosts playbooks/remove_webservers.yml --limit=web2
11 years ago
11 years ago
***Adding a node to the cluster.
Adding a node to the cluster can be done by executing the following command
ansible-playbook -i hosts playbooks/add_webservers.yml --limit=web2
11 years ago
11 years ago
***Rolling update of the entire site or a single hosts
11 years ago
Rolling updates are the preffered way to do an update as this wont affect the end users, In this example the hosts are updated in serial fashion, which means
that only one server would be updated at one time, this behaviour can be changed by setting the 'serial' keyword in webservers.yml file.
Once the code has been updated in the repository which can be defined in the group_vars/all file, execute the following command:
11 years ago
ansible-playbook -i hosts playbooks/rolling_update.yml
11 years ago