Appendix A. Setting up Elasticsearch

 

In this appendix, we’ll cover installing and setting up the Elasticsearch database used in Chapters 6 and 7. Instructions for both Linux and Windows installations are included. Note that if you get into trouble or want further information on Elasticsearch, it has pretty decent documentation you can find located at https://www.elastic.co/guide/en/elasticsearch/reference/1.4/setup.html.

Note

Elasticsearch is dependent on Java, so we’ll cover how to install that as well.

A.1. Linux installation

First check to see if you have Java already installed on your machine.

1.  You can check your Java version in a console window with java –version. If Java is installed, you’ll see a response like the one in figure A.1. You’ll need at least Java 7 to run the version of Elasticsearch we use in this book (1.4). Note: Elasticsearch had moved on to version 2 by the time this book was released, but while code might change slightly, the core principles remain the same.

Figure A.1. Checking the Java version in Linux. Elasticsearch requires Java 7 or higher.

2.  If Java isn’t installed or you don’t have a high enough version, Elasticsearch recommends the Oracle version of Java. Use the following console commands to install it.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get install oracle-java7-installer

Now you can install Elasticsearch:

A.2. Windows installation