visit
Here’s a video:
Maintaining Docker at scale, I’m more frequently concerned with clusters of VMs than the containers themselves.
The irony of this is not lost on me. Frequently I need to spin up clusters of machines. Either this is very slow/unreliable (Enterprise OpenStack implementation) or expensive (Amazon).The obvious answer to this is to use Vagrant, but managing this can be challenging.
So I present here a very easy way to set up a useful Vagrant cluster. With this framework, you can then automate your ‘real’ environment and play to your heart’s content.
$ pip install shutit$ shutit skeleton
[hit return to take default]
[type in vagrant]
vagrant
How many machines do you want (default: 3)? 3[hit return to take default]
What do you want to call the machines (eg superserver) (default: machine)?[hit return to take default]
Do you want to have open ssh access between machines? (default: yes) yes
[follow the instructions to run up your cluster.
$ cd /Users/imiell/shutit_resins && ./run.sh
This will automatically run up an n-node cluster and then finish up. NOTE: Make sure you have enough resources on your machine to run this! BTW, if you re-run the run.sh it automatically clears up previous VMs spun up by the script to prevent your machine grinding to a halt with old machines.
# Install apacheshutit.login(command='vagrant ssh machine1')shutit.login(command='sudo su - ')shutit.install('apache2')shutit.logout()shutit.logout()
# Go to machine2 and call machine1's servershutit.login(command='vagrant ssh machine2')shutit.login(command='sudo su -')shutit.install('curl')shutit.send('curl machine1.vagrant.test')shutit.logout()shutit.logout()
Will set up an apache server and curl a request to the first machine from the second.
Get 39% off with the code: 39miell