InMotion Hosting Support Center

Elasticsearch is an incredibly powerful search engine in which data can be stored and recalled in real-time. Because of the speed and reliability of Elasticsearch, it is highly recommended if you are searching through large amounts of data on a regular basis. Thanks to projects like ElasticPress, it can also be used easily within WordPress as a replacement for the default search. In this article, we will show you how to install Elasticsearch on InMotion Hosting or any other CentOS/Red Hat based system.

Note: You will need to have a VPS or dedicated server with root access to be able to install Elasticsearch.

Installing Elasticsearch from the repository

The easiest way to install Elasticsearch is from their repositories. Doing so is not only simple to install, but will also allow you to easily keep Elasticsearch updated.

  1. First, SSH into your server as root.

  2. Now, as Elasticsearch depends on Java to run, we will need to begin installing Java on the server. To do so, first begin by updating the repositories:

    yum update

    Now, install Java:

    yum install java

    If all goes well, Java should now be installed on the server and you are ready to begin installing Elasticsearch.

  3. Next, we will add the Elasticsearch repository to the server. Begin by adding the public signing key:

    rpm --import https://packages.elasticsearch.org/GPG-KEY-elasticsearch

  4. Now, we need to add the actual repository. Use the following to open a text editor and create a new file holding the Elasticsearch repository:

    nano /etc/yum.repos.d/elasticsearch.repo

    Within the text editor, paste in the following:

    [elasticsearch-1.4]
    name=Elasticsearch repository for 1.4.x packages
    baseurl=http://packages.elastic.co/elasticsearch/1.4/centos
    gpgcheck=1
    gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
    enabled=1

    Once entered, press Ctrl+X and then the Y key to save changes.

  5. Not that the repository is all set up, Elasticsearch is ready to install. To do so, enter the following:

    yum install elasticsearch

    Elasticsearch will now be installed. Once complete, if you want it to automatically start when the system is booted, follow the next section on setting ElasticSearch as a system service.

Setting ElasticSearch as a system service

If you want Elasticsearch to automatically when the system is started, enter the following command to se it as a system service:

chkconfig --add elasticsearch

.

Elasticsearch with WordPress

In addition to Elasticsearch's many use cases, individuals can easily integrate Elasticsearch with WordPress. For more information on doing so, take a look at our article on Elasticsearch in WordPress using ElasticPress.

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Elasticsearch not running by itself
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2016-11-23 11:27 pm

Thx for your guide, it was almost perfect in my case. What I changed was, in step 4:

 

[elasticsearch-1.7]

name=Elasticsearch repository for 1.7.x packages

baseurl=http://packages.elastic.co/elasticsearch/1.7/centos

gpgcheck=1

gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch

enabled=1

 

And then 

sudo nano /etc/elasticsearch/elasticsearch.yml

using these options:

network.host: 0.0.0.0

http.port: 9200

And finally,

sudo service elasticsearch start

 

n/a Points
2016-04-14 5:49 am

Fix the tutorial Please !@!@ 

Staff
30,388 Points
2016-04-14 12:10 pm
Hello Amit,

Thank you for contacting. We recently tested this article successfully, and everything seems to be working.

What issues are you having with the guide?

Are getting any errors? What are they?

Thank you,
John-Paul
n/a Points
2016-01-06 11:40 pm

This page needs updated, the URL for the repository is now packages.elastic.co. Also, newer versions exist beyond 1.4.

 

Staff
10,059 Points
2016-01-07 9:58 am
Thank you for letting us know. We'll certainly review the article and update where necessary.
n/a Points
2015-03-10 2:57 am

Hello,

After struggling a bit, I managed to get it running. For some reasons, my webservices which are calling the elastic client, are only working inside a specific folder.

Thanks anyway!

n/a Points
2015-03-09 11:51 pm

Hello,

One of the reason I chose inmotion for my website is because it provides a tutorial for installing elasticsearch, which is present in my website. I have already followed all the steps successfully. But the service is not working on the website. I am getting the following error response on php services that creates an elastic search client :

Fatal error: Class 'Elasticsearch\Client' not found in /home/catove5/public_html/catovert/gateway/app/init.php on line 5

Can you please indicate what should be done next to get it running on the website?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

7 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!