In Elasticsearch ecosystem, it can be immensely useful to monitor nodes and cluster to manage and improve their performance and state. There are several issues that can arise at cluster level, such as:
Node overheads, where some nodes can have too many shards allocated and can become a bottleneck for the entire cluster
Node shutdown can happen due to many reasons, for example, full disks, hardware failures, and power problems
Shard relocation problems or corruptions, in which some shards are unable to get an online status
Too large shards happens when a shard is too big; the index performance decreases due to Lucene massive segments merging
Empty indices and shards waste memory and resources, but because every shard has a lot of active threads if there is a huge number of unused indices and shards, the general cluster performance is degraded
Node problems such as high CPU usage or disk full
Detecting malfunction or bad performances can be done via API or via some frontends that are...
Cerebro is the evolution of the previous Elasticsearch plugin Elasticsearch kopf (https://github.com/lmenezes/elasticsearch-kopf) that doesn't work in Elasticsearch 5.x or above due to removing of site plugins.
Cerebro is a partial rewrite of the previous plugin available as a self-working application server.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
Java JVM version 8.x or above must be installed to run Cerebro.
For installing Cerebro, you need to download it and manually install its plugin. We will now perform the following steps:
You can download a binary distro of Cerebro at https://github.com/lmenezes/cerebro/releases. For Linux/MacOSX, we can use the following command:
wget https://github.com/lmenezes/cerebro/releases/download /v0.4.2/cerebro-0.4.2.tgz
Now you can extract it...
The most famous Elasticsearch interface is Kibana, which from Elasticsearch 5.x version has the same version of Elasticsearch. Kibana is an opensource pluggable interface, free to change to be used for Elasticsearch. It provides data visualization and data discovery and with commercial products such as X-Pack, and also supports security, graph, and cluster monitoring.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
For installing Kibana, we will perform the following steps:
Download a binary version for Elasticsearch website and unpack it. For Linux, the commands are as follows:
wget https://artifacts.elastic.co/downloads/kibana/kibana- 5.1.1-linux-x86_64.tar.gz tar -xzf kibana-5.1.1-linux-x86_64.tar.gz
On MacOsX, you can install Kibana via the following command:
brew install kibana...
The core of Kibana are the dashboards--an aggregation of widgets that are results of queries and aggregations.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in the Installing Kibana and X-Pack recipe.
For managing Kibana dashboards, we will perform the following steps:
We access the Discovery section of Kibana as shown in the following screenshot:
After a few seconds, the default search frontend should appear. The default query is *
, which is executed against the _all
field.
X-Pack provides cluster functionalities that allows to control and monitor your nodes and cluster. This is a very useful component of X-Pack as it is the lifesaver on large installations.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in the Installing Kibana and X-Pack recipe.
To use X-Pack Elasticsearch monitor, we will perform the following steps:
We access the Monitoring section of Kibana as shown in the following screenshot:
In the main page, you can access the different sections on monitoring applications as shown in the following screenshot:
If you click on the Overview cluster, you are able to see global cluster status and statistics...
X-Pack provides cluster functionalities that allow you to control and monitor your nodes and cluster. This is a very useful component of X-Pack as it is the lifesaver on large installations.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in the Installing Kibana and X-Pack recipe. The X-Pack is not needed.
To use X-Pack Elasticsearch monitor, we will perform the following steps:
We access the Dev Tools section of Kibana as shown in the following screenshot:
Now we can use the dev console to create/execute/test queries and other Elasticsearch HTTP API via it as shown in the following screenshot:
Kibana allows you to create reusable data representations called Visualizations. They are representations of aggregations and can be used to power up the dashboard with custom graphs.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in Installing Kibana and X-Pack recipe. The X-Pack is not needed.
To use Kibana to create custom widgets, we will perform the following steps:
We access the Visualize section of Kibana as shown in the following screenshot:
Now we can choose the visualization that we want to create as shown in the following screenshot:
If we want to create a Tag cloud visualization, we select it and populate the required fields as shown in the following screenshot:
As Elasticsearch, Kibana allows to be extended with plugins that can be installed to increment its functionalities.
In this recipe, we will install 3D pie chart, bars chart, and bubbles chart visualizations available at https://github.com/aparo/3D_kibana_charts_vis.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in the Installing Kibana and X-Pack recipe. The X-Pack is not needed.
As the plugins that we are installing is very new, they are not packaged as binary zip, we need to install via source code using git
and npm
of Node.js.
X-Pack for Elasticsearch and Kibana 5.x or above provides a graph API to discover relations in your data. The Elasticsearch graph is built in real-time, extracting relations from the indexed data.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
You also need a functional Kibana installation as described in the Installing Kibana and X-Pack recipe.
To create a custom graph view, we will perform the following steps:
We access the Graph section of Kibana as shown in the following screenshot:
A graph works on an index pattern, so we need to select the one that is available to start creating our graph as shown in the following screenshot:
In an Elasticsearch graph, values in a field are our vertices: we need to select the field that contains our vertices. The field list is extracted from the index pattern as shown in the following...