/ Mac OS X

How to automatically run elasticsearch on Startup for Mac OS X

If you are like me you want most of the things to be automate like my previous post showing you how to run MongoDB on StartUp for Mac OS X, and this post I'm going to show you how to do that for elasticsearch.

Assuming you had elasticsearch installed (by HomeBrew).

If you simply run this:

ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents

And try restart your Mac or your terminal you will see that your elasticsearch service has been started and ready to work on.

I'm don't think this will work for one that you install with MacPort or manual install, but this is the file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
      <string>-D es.config=/usr/local/Cellar/elasticsearch/0.90.11/config/elasticsearch.yml</string>

It might work if you have that file link and make sure all the path is correct above.