Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Desi (Developper ElasticSearch Installer) is very simple tool to quickly set up an Elastic Search local install for development purposes.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.travis.yml Add more rubies to Travis's builds
LICENSE Improve description of 'desi current VERSION'
Rakefile make rake run specs by default


Build Status Gem Version

Desi (Developper Elasticsearch Installer) is very simple tool to quickly set up an Elastic Search local install for development purposes.

It can:

  • download and install Elasticsearch (the latest release by default)
  • start/stop/restart it.
  • do basic indices management (list, delete, empty a given set of indices)

It can be used both as a command-line tool and as a library.

Usage (command-line)

$ desi list                  # List locally installed Elasticsearch releases
$ desi releases              # List all upstream Elastic Search releases (latest 5 by default)
$ desi install [VERSION]     # Install a specific version (latest by default)
$ desi start                 # Start a local 1-node cluster (noop if active)
$ desi restart               # (Re)start cluster (even if active)
$ desi stop                  # Stop cluster
$ desi status [--host HOST]  # Show running cluster info
$ desi tail                  # Show tail output from Elastic Search's log file
$ desi current               # Show current version
$ desi current VERSION       # Change the symlink pointing to current version

$ desi indices "^foo"          # List all indices whose name match /^foo/
$ desi indices "^foo" --delete # Delete all matching indices
$ desi indices "^foo" --close  # Close all matching indices
$ desi indices "bar$" --empty  # Remove all records from the matching indices

Examples (command-line and Ruby)

Installing Elastic Search

 $ # The latest version will be installed by default
 $ desi install
 * No release specified, will fetch latest.
 * fetching release elasticsearch-1.0.1.tar.gz

 $ # You can also give a specific release name
 $ desi install 0.90.12 # ("v0.90.12" or "elasticsearch-0.90.12" would also work)
 * fetching release elasticsearch-0.90.12.tar.gz

Get the list of locally installed releases

The current version is the one symlinked to $HOME/elasticsearch/current, that will be spun up by (desi start)

  • command-line

    $ desi list
    Local ES installs in /home/me/elasticsearch (current one is tagged with '*'):
      * elasticsearch-1.0.1 (/home/me/elasticsearch/elasticsearch-1.0.1)
      - elasticsearch-1.0.0 (/home/me/elasticsearch/elasticsearch-1.0.0)
  • library #=> ["elasticsearch-1.0.0", "elasticsearch-1.0.1"] #=> "1.0.1"

Start a node instance and get the cluster's status

  • command-line

    $ desi start
    * Elastic Search 1.0.1 started
    $ desi status
    OK. Elastic Search cluster 'elasticsearch' (v1.0.1) is running on 1 node(s) with status yellow
    # Start Elastic Search in the foreground
    $ desi start -f # or --foreground
    ES will be launched in the foreground
    ^C # Manual stop with Control-C
    Elastic Search interrupted!
  • library #=> "OK. Elastic Search cluster 'elasticsearch' (v1.0.1) is running on 1 node(s) with status green"

List and delete some indices

  • command-line

    $ # List all local indices
    $ desi indices
      Indices from host matching the pattern /.*/
    $ # List all indices with "foo" in their name on remote cluster, port 9800
    $ desi indices --host foo
      Indices from host matching the pattern /foo/
    $ # Remove all indices whose name starts with "ba"
    $ desi indices --delete "^ba"
    The following indices from host are now deleted
    * bar
    * baz
  • library

    # All local indices #=> ["foo", "bar", "baz"]
    # All local indices whose name starts with "b""^b") #=> ["bar", "baz"]
    # All indices from distant cluster "").list #=> ["remotefoo1", "remotefoo2"]
    # Delete all local indices whose name starts with "ba"!("^ba") #=> nil
    # The indices actually disappeared! \o/ #=> ["foo"]

Change setting(s)

There are two settings at the moment: location of the installation directory (directory, default: ~/elasticsearch) and ES host address (server, default: localhost:9200).

Desi will look for files /etc/desi.yml or ~/.desi.yml (the options found in the former will be overriden by the ones found in the latter).

  • command-line

    echo -e "---\n directory: ~/foobar" > ~/.desi.yml for instance

  • library

    Desi.configure do |c| = "~/local/foo"
      c.server = ""


Add this line to your application's Gemfile:

gem 'desi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install desi


  • add more tests

  • plugin management ? (list, install, remove ES plugins)


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.