Install Elasticsearch - elasticsearch - elasticsearch tutorial - elastic search
Elasticsearch Installation
- Elasticsearch requires at least Java 8. Specifically, as of this writing, it is recommended that you use the Oracle JDK version 1.8.0_131.
- Java installation varies from platform to platform so we won’t go into those details here. Oracle’s recommended installation documentation can be found on Oracle’s website.
- Be sufficient to say, before you install Elasticsearch, please check your Java version first by running (and then install/upgrade accordingly if needed):
Steps for installation of Elasticsearch
- Step 1: Check the minimum version of your java in installed your computer, it should be java 7 or more updated version. You can check by doing the following
- In Windows Operating System (OS) (using command prompt) −
- In UNIX OS (Using Terminal) −
- Step 2: Download Elasticsearch from www.elastic.co
- For windows OS download ZIP file.
- For UNIX OS download TAR file.
- For Debian OS download DEB file.
- For Red Hat and other Linux distributions download RPN file.
- APT and Yum utilities can also be used to install Elasticsearch in many Linux distributions.
- Step 3:Installation process for Elasticsearch is very easy and described below for different OS −
- Windows OS: Unzip the zip package and the Elasticsearch is installed.
- UNIX OS Extract tar file in any location and the Elasticsearch is installed.
- Using APT utility for Linux OS −
- Download and install the Public Signing Key −
- Save the repository definition −
- Run update −
- Now you can install by using the following command −
- Using YUM utility for Debian Linux OS −
- Download and install the Public Signing Key −
- ADD the below text in the file with. repo suffix in your “/etc/yum.repos.d/” directory. For example, elasticsearch.repo
- You can now install Elasticsearch by using the following command −
- Step 4: Go to the Elasticsearch home directory and inside the bin folder. Run the elasticsearch.bat file in case of windows or you can do the same using command prompt and through terminal in case of UNIX rum Elasticsearch file.
- In Windows −
- In Linux −
Note: in case of windows, you might get error stating JAVA_HOME is not set, please set it in environment variables to “C:\Program Files\Java\jre1.8.0_31” or the location where you installed java.
- Step 5 : Default port for Elasticsearch web interface is 9200 or you can change it by changing http.port inside elasticsearch.yml file present in bin directory. You can check if the server is up and running by browsing http://localhost:9200. It will return a JSON object, which contains the information about the installed Elasticsearch in the following way −
- Step 6: You can install fiddler2 from www.telerik.com as a front end for your Elasticsearch.
- In the configure window of fiddler2, you can hit the address of Elasticsearch adding an index and if you want, then the type/mapping also using HTTP POST method, for example −
- Address bar
- Request body − You can add JSON object, which will get store into that index.
- You can use the same for searching anything by just adding “_search” keyword at the end of URL and sent a query in request body for example
- Address bar
- Request body
- { "query":{ "match_all":{} } }
- This query will return everything from that index, which belongs to that particular type.
- You can delete a particular index or type by just putting the URL of the same in address bar and hit it with HTTP DELETE method.