Vagrant provisioning with puppet creating 4(servers) to testing nginx upstream load balacing
Inner project example https://github.com/EderRoger/AngularMongo
Install Vagrant
add the box
vagrant box add hashicorp/precise32 http://files.vagrantup.com/precise32.box
cd AngularMongo
sudo npm install
bower install
vagrant up
#Config mongo replicasets
vagrant ssh db
mongo
rs.initiate()
rs.conf()
rs.add("mongo1.replica.com")
rs.add("mongo2.replica.com")
#Open the shell 1:
vagrant ssh server1
cd /vagrant/AngularMongo
npm start
#Open the shell 2:
vagrant ssh server2
cd /vagrant/AngularMongo
npm start
#Open the shell 3:
vagrant ssh server3
cd /vagrant/AngularMongo
npm start
Open your web browser and access: http://192.168.33.13/app/#/people or
open the shell and execute benchmark testing. The following code execute 500 requests try it :) and look the servers responding:
ab -c 40 -n 500 http://192.168.33.13/
Look each terminal and see loadbalancing in action.
#Replica set terminal:

