This is a very simple load balancer with Vagrant + NGINX + Tornado + MySQL + REDIS
- Clone this repository into some folder
- Open console, go to this folder and type
vagrant up
After you write vagrant up
you will have 5 virtual machines:
#####- Name: vm_master | IP: 192.168.50.5
The Master VM, who is going to do the load balance
This vm will do:
- Update apt cache
- Install and Configure NGINX
#####- Name: vm_1 | IP: 192.168.50.10 This vms will do:
- Update apt cache
- Install and Configure NGINX
- Install PIP and the project dependences
- Install VirtualEnv and create a new VirtualEnv called
venv
into/vagrant
- Install and Configure Supervisor
#####- Name: vm_2 | IP: 192.168.50.20 This vms will do:
- Update apt cache
- Install and Configure NGINX
- Install PIP and the project dependences
- Install VirtualEnv and create a new VirtualEnv called
venv
into/vagrant
- Install and Configure Supervisor
#####- Name: vm_3 | IP: 192.168.50.30 This vms will do:
- Update apt cache
- Install and Configure NGINX
- Install PIP and the project dependences
- Install VirtualEnv and create a new VirtualEnv called
venv
into/vagrant
- Install and Configure Supervisor
#####- Name: vm_mysql | IP: 192.168.50.100 This vm will do:
- Update apt cache
- Install PIP
- Install MySQL
- Create the database:
app_db
- Create the user:
remoto
with password:123
- Grant all permissions to user
remoto
to the databaseapp_db
- Create the database:
#####- Name: vm_redis | IP: 192.168.50.200 This vm will do:
- Update apt cache
- Install REDIS
The machine responsible for the load balancer is serving on ip 192.168.50.5
.
After the vagrant up
you can access to http://192.168.50.5
and see the magic ;)
The MySQL machine is serving on ip 192.168.50.100
with one database called app_db
, user remoto
and password 123
.
The REDIS machine is serving on ip 192.168.50.200
in default port: 6379
Create another vm for REDISInstallsupervisor
in vmsConfigure supervisor in all vms- Develop the API
- Develop the application