Elastic Multi Master Replication OpenLdap. Stage 1, The Development Environment



This is a effort to implement a Elastic Multi Master Replication OpenLdap using orquestation and containers. The work is divided in multiples stages, each is build over the last and add new features to the project.

Deploying 5 virtual machines with virtualbox, Vagrant, and ubuntu OS


The first step is build our test infrastructure with some virtual machines where we'll raise the docker layer.

Vagrant is a powerful Ruby tool to do it, this software can hide the especial design configuration of nearly all hypervisors in the market letting to system administrators make the job faster.


Vagrant call the hypervisor to raise the virtual machines



Install Vagrant

First, we need Ruby and Vagrant installed in our System, in any Debian based Linux there are a package and we must to install with:

sudo apt-get install vagrant
But there are another form to install Vagrant, using the rubygems, for example in Centos you can do


sudo yum install ruby rubygems
Install ruby tools in the system and let to get software in the form of package ("gems"):

sudo gem update --system
sudo gem install vagrant

Install VirtualBox

For the demostration we need a flexible virtual enviroment to do all the tests that we need. The faster manner to do the deployment is usign a local virtual enviroment: VirualBox.
Oracle VirtualBox is a virtualization solution that deploy a local hypervisor.

You can download and install VirtualBox from here.




VagrantFile

Vagrant use a configuration file called "VagrantFile" where we must configure all the viurtual machines to be raised and the procedures to do it. In the configuration we select virtualbox as a provider.


Simple Vagrant configuration

The servers.yaml file where each machine is defined:


Simple virtual machines definition



Stage 1 Shell Execution

These are the steps followed to raise the virual machines and a video with the execution.

$ sudo vi /etc/apt/sources.list.d/virtualbox.list
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get -y install virtualbox-5.0 dkms vagrant git
$ git clone -b stage1 https://github.com/aescanero/elasticmmldap elasticmmldap_stage1
$ cd elasticmmldap_stage1
~/elasticmmldap_stage1$ vagrant up
The test is:

~/elasticmmldap_stage1$ vagrant ssh swarm-master-1
$ ping 192.168.8.3
And clear everything with:


~/elasticmmldap_stage1$ vagrant destroy -f
You can access to the code of the example in https://github.com/aescanero/elasticmmldap/tree/stage1