Elasticsearch has an active community and the release cycles are very fast.
Because Elasticsearch depends on many common Java libraries (Lucene, Guice, and Jackson are the most famous ones), the Elasticsearch community tries to keep them updated and fixes bugs that are discovered in them and in Elasticsearch core. The large user base is also source of new ideas and features for improving Elasticsearch use cases.
For these reasons, if it's possible, the best practice is to use the latest available release (usually the more stable one and the less bugs free).
A supported Elasticsearch operative system (Linux/MacOSX/Windows) with a Java JVM 1.8 (the Oracle one is the preferred http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) or above installed. A web browser is required to download the Elasticsearch binary release. At least 1GB of free disk space is required to install Elasticsearch.
For downloading and installing an Elasticsearch server, we will perform the steps given as follows:
We download Elasticsearch from the Web. The latest version is always downloadable at the web address https://www.elastic.co/downloads/elasticsearch. The three versions that are available for different operative systems are as follows:
elasticsearch-{version-number}.zip
is for both Linux/Mac OSX and Windows operative systemselasticsearch-{version-number}.tar.gz
is for Linux/Macelasticsearch-{version-number}.deb
is for Debian-based Linux distributions (this also covers the Ubuntu family); it is installable with the Debian command dpkg -i elasticsearch-*.deb
elasticsearch-{version-number}.rpm
is for RedHat-based Linux distributions (this also covers the Centos family). It is installable with the rpm -i elasticsearch-*.rpm
command.The preceding packages contain everything to start Elasticsearch. This book targets version 5.x or above, the latest and most stable version of Elasticsearch was 5.1.1. To check out whether it's latest or not, visit https://www.elastic.co/downloads/elasticsearch.
We extract the binary content. After downloading the correct release for your platform, the installation involves expanding the archive in a working directory.
For Windows platform, a good directory could be c:es
, on Unix and MacOSX /opt/es
.
To run Elasticsearch, you need a Java Virtual Machine 1.8 or above installed. For better performances, I suggest you to use the latest Sun/Oracle 1.8 version.
If you are a Mac OS X user and you have installed Homebrew (http://brew.sh/), the first and the second step are automatically managed by the command brew install elasticsearch
.
We start Elasticsearch to check if everything is working. To start your Elasticsearch server, just install the directory and type for Linux and MacOsX:
# bin/elasticsearch
Alternatively, you can type the following for Windows:
# binelasticserch.bat
Your server should now start up as shown in the following screenshot:
The Elasticsearch package generally contains three directories:
bin
: This contains the script to start and manage Elasticsearch. The most important ones are and follows:.bat
): This is the main script to start Elasticsearch.bat
): This is a script to manage plugins config
: This contains the Elasticsearch configs. The most important ones are as follows:elasticsearch.yml
: This is the main config file for Elasticsearchlog4j2.properties
: This is the logging config file lib
: This contains all the libraries required to run Elasticsearchmodules
: This contains the Elasticsearch default module extensionsplugins
: This contains the installed pluginsDuring Elasticsearch start up a lot of events happened:
src/main/resources/config/names.txt
).whqVp_4zQGCgMvJ1CXhcWQ
).aggs-matrix-stats
: This acts as a good support for aggregation matrix statsingest-common
: These include common functionalities for ingestinglang-expression
: This acts as a good support for Expression languagelang-groovy
: This acts as a good support for Groovy languagelang-mustache
: This acts as a good support for Mustacle languagelang-painless
: This acts as a good support for Painless languagepercolator
: This acts as a good support for percolator capabilitiesreindex
: This acts as a good support for reindex action9300
is used for internal intranode communication9200
is used for HTTP rest API If these port numbers are already bound, Elasticsearch automatically increments the port number and tries to bind on them until a port is available (that is, 9201
, 9202
, and so on). This feature is very useful when you want to fire up several nodes on the same machine mainly for testing and developing.
There are more events that are fired during Elasticsearch start-up. We'll see them in detail in other recipes.
18.117.74.231