<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://brokenco.de//feed/by_tag/vagrant.xml" rel="self" type="application/atom+xml" /><link href="https://brokenco.de//" rel="alternate" type="text/html" /><updated>2026-05-03T00:12:50+00:00</updated><id>https://brokenco.de//feed/by_tag/vagrant.xml</id><title type="html">rtyler</title><subtitle>a moderately technical blog</subtitle><author><name>R. Tyler Croy</name></author><entry><title type="html">3 Elasticsearch nodes in 3 minutes</title><link href="https://brokenco.de//2014/04/08/three-elasticsearch-nodes-three-minutes.html" rel="alternate" type="text/html" title="3 Elasticsearch nodes in 3 minutes" /><published>2014-04-08T00:00:00+00:00</published><updated>2014-04-08T00:00:00+00:00</updated><id>https://brokenco.de//2014/04/08/three-elasticsearch-nodes-three-minutes</id><content type="html" xml:base="https://brokenco.de//2014/04/08/three-elasticsearch-nodes-three-minutes.html"><![CDATA[<p>For one of my newer projects at <a href="http://hackers.lookout.com">Lookout</a>, I’ve
been experimenting with <a href="https://elasticsearch.com">Elasticsearch</a> as the
primary data store. The advantages of Elasticsearch are many for my particular
use-case, but one of the things I particularly like about it is the distributed
nature of its design.</p>

<p>Like most modern data stores, Elasticsearch was built to be deployed in a
clustered environment where data is replicated automatically between various
nodes (Cassandra is also in this category). Also like most modern data stores,
most developers won’t run a cluster of Elasticsearch nodes for their local
development. They’ll only run one, and miss a lot of simple bugs that can crop
up from a distributed system. Such as (not a complete list):</p>

<ul>
  <li>The node you’re talking to goes down</li>
  <li>The node you’re talking to is too slow</li>
  <li>The node you’re talking to has become disconnected from the other nodes</li>
  <li>The data you’ve just written hasn’t yet been indexed (Elasticsearch specific)</li>
  <li>And of course, Heisenbugs!</li>
</ul>

<p>To make my life easier, I created the
<a href="https://github.com/rtyler/instant-elasticsearch">instant-elasticsearch</a>
repository. <code class="language-plaintext highlighter-rouge">instant-elasticsearch</code> uses a couple great tools to make it easy to
spin Elasticsearch nodes up and down in AWS:</p>

<ul>
  <li><a href="http://vagrantup.com">Vagrant</a></li>
  <li><a href="https://github.com/puppetlabs/puppet">Puppet</a></li>
  <li>The <a href="https://github.com/mitchellh/vagrant-aws">vagrant-aws</a> plugin for
Vagrant</li>
  <li>The <a href="http://forge.puppetlabs.com/elasticsearch/elasticsearch">elasticsearch/elasticsearch</a> Puppet module</li>
</ul>

<p>Combining these four building blocks with a simple Puppet
<a href="https://github.com/rtyler/instant-elasticsearch/blob/master/manifests/vagrant.pp">manifest</a>
and a clever
<a href="https://github.com/rtyler/instant-elasticsearch/blob/master/Vagrantfile">Vagrantfile</a>
and <code class="language-plaintext highlighter-rouge">instant-elasticsearch</code> is a <code class="language-plaintext highlighter-rouge">vagrant up</code> away from automatically
provisioning a <em>functional</em> and <em>self-discovering</em> Elasticsearch cluster.</p>

<p>Once the cluster is up and running, you will have to do the manual work of
copying some hostnames into your application’s configuration files but only
because I’ve not yet had a chance to automate that part (shame on me).</p>

<p>The workflow I use for <code class="language-plaintext highlighter-rouge">instant-elasticsearch</code> is one where I come
into the office in the morning, spin up my entire cluster fresh which takes
about 3-4 minutes. After it’s provisioned, I start my work. Throughout the day I
might shutdown some instances here and there to test some fault tolerance, but
for all intents and purposes the cluster remains mostly “up” until the end of
the day. At the end of the day, I make sure all my code is committed, then run
<code class="language-plaintext highlighter-rouge">vagrant destroy -f</code> to nuke my cluster.</p>

<p>All said and done I might spend a couple of bucks to save myself countless
hours of hunting down the subtle application bugs that might occur in
production without sufficient testing locally.</p>

<p>Not too bad for 80 lines of Puppet, and 50 lines of Ruby!</p>]]></content><author><name>R. Tyler Croy</name></author><category term="vagrant" /><category term="vagrant-aws" /><category term="puppet" /><category term="elasticsearch" /><summary type="html"><![CDATA[For one of my newer projects at Lookout, I’ve been experimenting with Elasticsearch as the primary data store. The advantages of Elasticsearch are many for my particular use-case, but one of the things I particularly like about it is the distributed nature of its design.]]></summary></entry><entry><title type="html">Introducing the Vagrant plugin for Jenkins</title><link href="https://brokenco.de//2012/03/13/introducing-the-vagrant-plugin.html" rel="alternate" type="text/html" title="Introducing the Vagrant plugin for Jenkins" /><published>2012-03-13T00:00:00+00:00</published><updated>2012-03-13T00:00:00+00:00</updated><id>https://brokenco.de//2012/03/13/introducing-the-vagrant-plugin</id><content type="html" xml:base="https://brokenco.de//2012/03/13/introducing-the-vagrant-plugin.html"><![CDATA[<p><em>Look! A <a href="http://unethicalblogger.com/2012/03/13/vagrant-plugin-in-action.html">screencast of the plugin in
action!</a></em></p>

<p>The impossible has happened. Not only have I written a plugin for Jenkins, I’ve
<em>released</em> it. An event I’ve long avoided has finally come to pass, mostly
thanks to the fantastic <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+plugin+development+in+Ruby">Ruby plugin development
support</a>
developed largley by <a href="https://github.com/cowboyd">Charles Lowell</a>.</p>

<center><img src="http://agentdero.cachefly.net/scratch/vagrant-plugin-0.0.3.png" alt="Vagrant plugin" /></center>

<p>The Vagrant plugin is still fairly new, and “beta” tested. Thus far I’ve
modeled it after the fantastic <a href="https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin">Android Emulator
plugin</a> in
that it will bring up a Vagrant VM for the duration of the job, and then
destroy it afterwards.</p>

<p>As you can see, the Vagrant plugin adds a couple new build steps to the
configure page. One thing to note is that the
<a href="http://vagrantup.com/docs/provisioners.html">provisioning</a> is operated as a
separate step, instead of bundled in with the boot of the Vagrant machine. This
is purposeful, to allow any additional set up of the environment prior to
running Puppet or Chef.</p>

<p>The plugin does of course expect that you have a functional VirtualBox
environment on the slave you’re running the job on, if you don’t, Vagrant will
explode with a fantastic stack-trace and probably burn your house down.</p>

<h4 id="in-the-near-future">In the near future</h4>

<p>I’m thinking about bundling
<a href="https://github.com/t9md/vagrant-snap">vagrant-snap</a> with the plugin to allow
fancy snapshotting support, but I’m not sure of a good definite usecase for
that just yet.</p>

<p>If there’s anything you’d like to see, please file a request on the <a href="https://github.com/rtyler/vagrant-plugin/issues">GitHub
issues page</a>.</p>

<hr />

<p>You can find the plugin:</p>

<ul>
  <li>in your Jenkins “Manage Plugins” page :)</li>
  <li><a href="https://github.com/rtyler/vagrant-plugin">on GitHub</a></li>
  <li><a href="https://wiki.jenkins-ci.org/display/JENKINS/Vagrant+Plugin">on the Jenkins wiki</a></li>
</ul>

<p><strong>Enjoy!</strong></p>

<p><strong>NOTE:</strong> Be sure to grab version 0.1.2 or later!</p>]]></content><author><name>R. Tyler Croy</name></author><category term="vagrant" /><category term="jenkinsci" /><category term="ruby" /><summary type="html"><![CDATA[Look! A screencast of the plugin in action!]]></summary></entry><entry><title type="html">Vagrant plugin for Jenkins in action</title><link href="https://brokenco.de//2012/03/13/vagrant-plugin-in-action.html" rel="alternate" type="text/html" title="Vagrant plugin for Jenkins in action" /><published>2012-03-13T00:00:00+00:00</published><updated>2012-03-13T00:00:00+00:00</updated><id>https://brokenco.de//2012/03/13/vagrant-plugin-in-action</id><content type="html" xml:base="https://brokenco.de//2012/03/13/vagrant-plugin-in-action.html"><![CDATA[<p>Since the Jenkins update center is taking a little bit longer to propogate the
release of the <a href="/2012/03/13/introducing-the-vagrant-plugin.html">Vagrant plugin for
Jenkins</a>, I figured I’d create
a little demonstration for you.</p>

<p>The demo is from a running development environment I have locally, but once the
v0.1.2 version of the plugin is available in the update center, all of this
will work for you as well.</p>

<center><iframe width="640" height="360" src="https://www.youtube-nocookie.com/embed/2o590cmra0g" frameborder="0" allowfullscreen=""></iframe></center>]]></content><author><name>R. Tyler Croy</name></author><category term="vagrant" /><category term="jenkins" /><category term="screencast" /><summary type="html"><![CDATA[Since the Jenkins update center is taking a little bit longer to propogate the release of the Vagrant plugin for Jenkins, I figured I’d create a little demonstration for you.]]></summary></entry></feed>