Install Elasticsearch On CentOS 6.5

Introduction

While setting up a new instance of SugarCRM 7.1 I reached a point in which Elasticsearch is required to continue. This is a very welcomed surprise! For those of you not familiar with full text search in SugarCRM, it offers the following benefits.

  • Full text search on keywords or partial words
  • Quick View previews search results with the search string highlighted
  • Prioritized results are shown first for the module from which the search is performed, followed by results from other modules
  • Wildcard searches
  • Include a field name in searches to filter results by matches to that field only
  • Show All link displays the full search results from each module in separate panels

Installation

While Googling I noticed a common theme of making installation way more difficult than it needed to be. Many tutorials have you install Elasticsearch, install a service wrapper, move files and directories here and there, etc. Overkill.

Installing it is pretty simple using the provided RPM from the Elasticsearch website.

cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk -y

wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.noarch.rpm

rpm -Uvh elasticsearch-0.90.10.noarch.rpm 

chkconfig elasticsearch on

If you are installing for SugarCRM (which is a majority of the traffic generated to this post), I recommend adding the following to the configuration file located at /etc/elasticsearch/elasticsearch.yml

Testing

Testing to make sure it works is pretty straight forward. Using curl we will make sure the service is running on the standard port of 9200.

curl http://localhost:9200

The results returned should resemble something along the following lines.

{
  "ok" : true,
  "status" : 200,
  "name" : "Vagabond",
  "version" : {
    "number" : "0.90.8",
    "build_hash" : "909b037218cf880e8772b066a764f179f2d5e719",
    "build_timestamp" : "2013-12-18T16:08:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.6"
  },
  "tagline" : "You Know, for Search"
}

Full Text Search Examples

See the following links for more information on how to use Elasticsearch as a whole and some more specific SugarCRM examples.

http://joelabrahamsson.com/elasticsearch-101/

http://developer.sugarcrm.com/2012/07/06/full-text-search-tricks/

6 thoughts on “Install Elasticsearch On CentOS 6.5

  1. I definetely would not recommend to install Elasticsearch as V. 0.90 anymore, since there the scripting engine is enabled by default. :-(
    This is a massive security risk. Go and get at least a 1.x version or the newest which is 1.3 (Date: August 2014)

    • While I agree, SugarCRM does not support 1.x. I will update this post to advise more accurately when to use which version as I get a lot of traffic for both generic ElasticSearch installs and SugarCRM related ElasticSearch installs.

      Thanks for the heads up!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *