Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rogerwelin/ansible-nginx
dynamic nginx loadbalancer in vagrant
https://github.com/rogerwelin/ansible-nginx
ansible nginx ruby
Last synced: 7 days ago
JSON representation
dynamic nginx loadbalancer in vagrant
- Host: GitHub
- URL: https://github.com/rogerwelin/ansible-nginx
- Owner: rogerwelin
- Created: 2015-06-25T21:03:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T21:32:57.000Z (over 9 years ago)
- Last Synced: 2024-11-24T13:09:10.391Z (2 months ago)
- Topics: ansible, nginx, ruby
- Language: Ruby
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ansible-nginx
## Synopsis
This project uses vagrant + ansible (and some homecooked scripting skills) to dynamically create a nginx round-robin load balancer cluster with any number of nodes (default 3) that connects
to the load balancer using etcd as a service discovery## Requirements
* Vagrant must be installed on the host machine
* Ansible must be installed on the host machine
* Host machine needs to reach https://github.com (for fetching etcd)
* Port 9999 on host machine needs to be unused, otherwise change this port in Vagrantfile## Instructions
* To change number of nginx nodes used by the load balancer, change the value of the variable 'NUM_NODES' in Vagrantfile
* vagrant up
* run ruby script to calculate the distributed load across the nodes:
```shell
./epicrubylb.rb
Command-line utility for calculating even lb ngix round-robin load../epicrubylb.rb [-n Number of requests to lb]
Example: ./epicrubylb.rb -n 100
Expected output:
node1: 50
node2: 50
-n, --num-requests [Requests] The total number of request sent to lb
-h, --help help
```