title: How to run an embedded elastic search instance for testing
body: <p>I'm working in a setup that has an embedded <a href="http://www.elasticsearch.org/" rel="noreferrer">elastic search</a> instance for unit testing purposes, but when I run the tests continuously with sbt (<code>~test-only &lt;my-test&gt;</code>) the system becomes increasingly unstable until it freezes and has to be killed with fire.</p>
  
  <p>Things I'm having a hard time getting to work properly are:</p>
  
  <ul>
  <li>isolation</li>
  <li>cleanup</li>
  <li>shutdown</li>
  </ul>
  
  <p>What is the proper way to set this up, (solutions preferably using specs2, but Java based is also welcome)?</p>