Elasticsearch Kibana server is not ready yet – Code Example

Total
0
Shares

There could be number of reasons where you get the error, Kibana server is not ready yet. Some of them includes –

  • Configuration error in Kibana indexes
  • Wrong elastic.hosts settings.
  • Enabled xpack.security plugin at elasticsearch.yml.
  • Incompatible Kibana Version
  • Wrong host binding in Kibana and Elasticsearch.
  • Kibana trying to load module which are not installed on master node.
  • Virtual memory is low
  • Elasticsearch service not running

Solutions with Code Example

1. Configuration error in Kibana indexes –

Delete all Kibana indexes –

curl --request DELETE 'http://elastic-search-host:9200/.kibana*'

Replace protocol, elastic-search-host and port according to your case.

2. Wrong elastic.hosts settings

Follow these steps –

  1. Open /etc/elasticsearch/elasticsearch.yml file and check the setting on:
    #network.host: localhost
  2. Open /etc/kibana/kibana.yml file and check:
    #elasticsearch.hosts: [“http://localhost:9200”]
  3. You should have the same settings for both of them. If you are using localhost then both should have localhost. If using IP then both should have the same IP.

3. Enabled xpack.security plugin at elasticsearch.yml

If you enabled the xpack.security then Kibana might not be able to access elasticsearch locally. Open /etc/elasticsearch/elasticsearch.yml file and check – xpack.security.enabled : true

If it is true, then you need to uncomment these configuration options too –

elasticsearch.username = kibana
elasticsearch.password = your-password

Otherwise you can also comment out the xpack security configuration.

Save the file and restart Kibana service – sudo systemctl restart kibana.service

4. Incompatible Kibana Version

Sometimes your Kibana version is not compatible with elasticsearch and your get the error – This version of Kibana (v7.6.1) is incompatible with the following Elasticsearch nodes in your cluster: v6.8.1 @ :9200 ().

The solution to this issue is to install appropriate versions according to this table – https://www.elastic.co/support/matrix#matrix_compatibility

5. Wrong host binding in Kibana and Elasticsearch

  1. Open /etc/elasticsearch/elasticsearch.yml file and uncomment:
    #network.host: localhost
  2. Open /etc/kibana/kibana.yml file and uncomment:
    #elasticsearch.hosts: [“http://localhost:9200”]

6. Virtual memory is low

If the virtual memory is low then heap will overflow and it will throw error –

For Linux's docker hosts only. By default 
virtual memory is not enough so run the next command as root sysctl -w vm.max_map_count=262144

To resolve this issue, you need to assign more memory to the VM using this command –

sysctl -w vm.max_map_count=262144

7. Elasticsearch service not running

This is unlikely but could be the possibility. Because if you are working on elasticsearch & Kibana, you will always make sure that services are running. But if it’s not, then start them using this command –

sudo systemctl status elasticsearch