Installing and using Cerebro

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.

Getting ready

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.

How to do it...

For installing Cerebro, you need to download it and manually install its plugin. We will now perform the following steps:

  1. 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
    
  2. Now you can extract it, via the following command:
            tar xfvz cerebro-0.4.2.tgz
    
  3. Now you can execute it via following command:
            cerebro-0.4.2/bin/cerebro
    
  4. Alternatively, for Windows, use the following command:
            cerebro-0.4.2incerebro.bat
    
  5. In the console, you should see the following output:
            [warn] application - Logger configuration in conf files is 
            deprecated and has no effect. Use a logback configuration file 
            instead.
            [info] play.api.Play - Application started (Prod)
            [info] p.c.s.NettyServer - Listening for HTTP on   
            /0:0:0:0:0:0:0:0:9000
    
  6. To access the web interface, you need to navigate with your browser at the address:
            http://0.0.0.0:9000/
    

How it works...

Cerebro is a modern reactive application written in Scala via the Play Framework for the backend REST and Elasticsearch communication and a Single Page Application (SPA) frontend written in Javascript with AngularJS.

By default, Cerebro binds on port 9000. You can navigate with a browser at the address http://0.0.0.0:9000 to view the following start page:

How it works...

In the start page, you can select a predefined host or you can manually insert the address of your Elasticsearch server. If you need, you can provide credentials for accessing your Elasticsearch cluster.

After having pressed connect, if everything is okay, you can access the Cerebro main page with your nodes view as shown in the following screenshot:

How it works...

The Cerebro main page provides a very large overview of your cluster and data; from top to bottom we have as follows:

  • The menu, where overview is a link to homepage, rest allows to send generic REST calls, and clicking on more we have additional admin functionalities as shown in the following screenshot:
    How it works...
  • The status line (green, yellow, or red: in this case, it is yellow because my cluster needs more nodes).
  • The line with cluster global stats, that includes the name of the cluster, number of nodes, number of indices, number of shards, number of documents, and size of your data.
  • The filter indices line where you can do as follows:
    • Filter the indices by name
    • Show/hide closed indices
    • Show/hide special indices (dot starting ones)
    • Filter by node names
    • Control the indices pagination
  • The main grid block that contains node and indices information. In the first column, we have as follows:
    • The general cluster control functionalities. The lock symbol allows you to lock the shard relocation at cluster level (useful for cluster restart management). The second symbol allows you to show extra node information such as JVM version and Elasticsearch version. The sorting simply allows you to sort nodes by name. The arrow symbol allows you to execute actions to all the selected indices such as close/open/refresh and cache clear.
    • The unassigned shards line allows you to check the unassigned shard for index.
    • The node information, where in a single cell we have node name, node ip, and heap/disk/cpu/load on the node. If these values are too high, they are showed in red.
  • In the other columns, we have indices information as follows:
    • Index name, number of shards, number of documents, and the total size. From the arrow, you can access action that can be executed against the index:
      How it works...
    • The shards are represented as a box with its number. Clicking on it, you can see additional shard info.

The main page or overview view is very rich of useful data. With a single look, you can scope nodes with high loads or full disk, how the shards are distributed in your cluster, and if there are problems with some indices.

Clicking on a particular index settings a form is open to change all the index options that can be changed as shown in the following screenshot:

How it works...

The create index page allows easy creating an index defining shards, replicas, or templates as shown in the following screenshot:

How it works...

The cluster settings page allows changing cluster mutable parameters from a simple interface. This is advanced usage, but the simplicity of the form speeds up cluster settings management as shown in the following screenshot:

How it works...

Managing repository can be achieved by using the repositories menu. The page allows you to define the name and the type of the repository to be used for future backup/restore actions as shown in the following screenshot:

How it works...

If a repository is created via interfaces or API, it can be used to execute backup and restore actions. Clicking on shapshot menu, you can access a page where:

  • On the right, you can create a snapshot selecting the repository, giving it a name, and selecting the indices that need to be backed up.
  • On the left, there is a list of available snaphots that can be restored as shown in the following screenshot:
    How it works...

There's more...

The preceding part of Cerebro allows you to cover special aspects of Elasticsearch management; in the rest menu, you can access a page where you can execute raw REST calls against Elasticsearch as shown in the following screenshot:

There's more...

Cerebro doesn't provide data visualization or discovery as Kibana, but it can execute raw REST against an Elasticsearch endpoint. With this functionality, queries can be tested against an Elasticsearch server. This is very handy to work a low level with Elasticsearch.

The rest interface also allows you to export the call as a curl command.

The Cerebro interface is quite new. The new features are in development and will be released in the near future.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.145.158