Kibana Server Not Ready Yet


“Kibana is a free and open-source analytics and visualization platform for Elasticsearch. It provides a browser-based graphical interface for interacting with your Elasticsearch database.

It is very simple and intuitive. You can perform operations such as search, view, update, delete and query all the indices in your Elasticsearch cluster. When it comes to visualization, it offers a wide range of options, including charts, tables, maps, etc.

However, Elasticsearch and Kibana have a notorious reputation for being difficult to set up and configure, especially when getting started.

As a result, you may encounter the “Kibana server is not ready yet” error when attempting to query your Kibana server.

In this tutorial, we will attempt to break down the cause of this error and give you potential solutions.”

Let’s get started.

What Causes the “Kibana is Not Ready Yet” Error?

There are five major reasons why this error occurs when attempting to connect to your Kibana cluster.

These include:

  1. Elasticsearch service is not running
  2. Incorrect Elasticsearch host settings
  3. Elasticsearch security plugin
  4. Corrupt version indices
  5. Incompatible Elasticsearch and Kibana Stack

Let us discuss how we can resolve these errors.

Error # 1 – Elasticsearch Service not Started

The first cause of this error is if the Elasticsearch server is not running. Therefore, ensure that elastic service is up and running. You can do this by running the sytemctl command:

1

$ sudo systemctl status elasticsearch

If the command above shows the service is running, you are good to go.

Error # 2 – Incorrect Elasticsearch Host Settings

The next is to check your Elasticsearch host settings. Ensure that your kibana cluster is able to access your Elasticsearch cluster.

You can do this by editing the Elasticsearch and Kibana configuration files.

Run the command below to edit the Elasticsearch configuration

1

$ sudo nano /etc/elasticsearch/elasticsearch.yml

Locate the entry below and uncomment it:

1
2
3

#network.host: localhost
to
network.host: localhost

NOTE: In some cases, the Elasticsearch configuration file is located in the install_dir/config directory.

In some cases, the above entry might contain your system’s IP address instead of localhost. Ensure to note down the IP address if that’s the case.

Next, edit your Kibana config file:

1

$ sudo nano /etc/kibana/kibana.yml

Locate the entry below:

1

# elasticsearch.hosts: [«http://localhost:9200»]

Uncomment the line to set the address for your Elasticsearch service.

1

elasticsearch.hosts: [«http://localhost:9200»]

NOTE: If your previous entry was set to an IP address, replace localhost with the target IP in the above entry as well.

Error # 3 – Xpack Security Plugin

In some cases, Kibana may fail to start if the security plugin is enabled with an incomplete configuration. To resolve this, edit your elasticsearch configuration and comment on the entry xpack plugin.

1

$ sudo /etc/elasticsearch/elasticsearch.yml

Comment the lines below by adding a # sign at the beginning.

1
2

xpack.security.enabled: true
xpack.security.enrollment.enabled: true

Save the file and restart the Elasticsearch and Kibana services.

Error # 4 Corrupt Versioned Indices

You can also resolve this issue by removing the versioned indices from your Kibana Cluster.

Start by getting the list of kibana versioned indices by running:

1

$ curl -XGET «https://localhost:9200/_cat/indices?v&index=.kib*&h=index»

The command should return the kibana indices.

1
2
3
4
5

index
.kibana_8
.kibana-event-log-8.2
.kibana_security_session_1
.kibana_task_manager_8.2

Next, start by enabling wildcard support by setting the action.desctructive_requires_name parameter to false for your cluster.

1
2
3
4
5
6

curl -XPUT «https://localhost:9200/_cluster/settings» -H ‘Content-Type: application/json’ -d
{
  «persistent» : {
    «action.destructive_requires_name» : false
  }
}’

Be careful when running the above command. It will allow various parameters to allow wildcards which can be dangerous in the long run.

You should get acknowledged by the server.

1
2
3
4
5
6
7
8
9

{
  «acknowledged» : true,
  «persistent» : {
    «action» : {
      «destructive_requires_name» : «false»
    }
  },
  «transient» : { }
}

Next, run the command below to remove all kibana indices.

1

curl -XDELETE «https://localhost:9200/.kibana*?expand_wildcards=open»

The command above will remove all the indices starting with .kibana.

NOTE: The above method is destructive and will drop all the kibana indices. Use with caution.

1
2
3

{
  «acknowledged» : true
}

You can verify the indices are removed by running:

1

curl -XGET «https://localhost:9200/_cat/indices?v&index=.kib*&h=index»«

This should return an empty result.

Finally, open your terminal and restart the kibana service:

1

$ sudo systemctl restart kibana

Error # 5 – Incompatible Elasticsearch and Kibana Stack

Another major cause of this error is if the Elasticsearch and Kibana stack is incompatible. If you are using different versions of the tools, you will run into this error.

To resolve this issue, ensure Kibana is compatible with the installed Elasticsearch Version. And vice versa.

ELK Stack Compatibility List is provided in the resource below:

https://www.elastic.co/support/matrix#matrix_compatibility

Closing

In this article, we explored five possible causes of the “Kibana Server Not Ready Yet” error and how to resolve it.

Thanks for reading!!



Source link