ELK Adventures Part 1

Vagrant Development Environment

Joaquín Menchaca (智裕)
2 min readMar 9, 2018

--

I am kicking of a small ELK (ElasticSearch-Logstash-Kibana) project and use vagrant for easy development. I will spin up a 3-node cluster with small package repository server that uses Aptly.

I will use the system I documented earlier in Vagrant: Dynamic Multi-Machines.

Configuration

For the configuration, I just create a hosts files (./config/hosts) to define my environment:

172.16.0.50 aptly-01.dev 
172.16.0.51 elk-01.dev primary
172.16.0.52 elk-02.dev
172.16.0.53 elk-03.dev

Vagrantfile

I will have a Vagrantfile that will read in the hosts file and create the systems.

I gave each of the ELK nodes 1 GB of memory, as standard 512 MB is too small for getting off the ground.

Chef Bento Box

Side note — I chose to use Ubuntu from one of Chef’s Bento boxes, as they have great track record in quality Vagrant boxes, and they have source code if you are interested to learn Packer. Alternatively, Official Ubuntu Vagrant boxes are also available. Just change the VAGRANT_BOX as needed for your project.

Start Environment

And with this, we’re off, all I do is vagrant up, wait for downloading the image, and then run vagrant status to see the systems up and running:

$ vagrant up
$ vagrant status
aptly-01.dev running (virtualbox)
elk-01.dev running (virtualbox)
elk-02.dev running (virtualbox)
elk-03.dev running (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific VM, run `vagrant status NAME`.

I can visually see the results with VirtualBox (screenshot from Zorin on my Asus Zenbook):

Virtualbox 5.2.x running on Zorin OS (Linux) on Asus Zenbook

I now have 4 virtual guest systems to develop the solution, before I move it to production caliber systems on GCP or AWS.

--

--

Joaquín Menchaca (智裕)

DevOps/SRE/PlatformEng — k8s, o11y, vault, terraform, ansible