'Kibana startup fails with License information and later with Unable to retrieve version information

I'm tried to follow this guideline for installing ELK on Centos 8 (on top of one AWS cluster).

After installing elastic and kibana, the kibana startup failed with:

*"message":"License information could not be obtained from Elasticsearch

I googled it, and realized I should use OSS version (latest is 7.10.2) so make sure to install only OSS version. you can use this guideline

after that, I got new error from kibana.log

-08T07:19:32Z","tags":["error","savedobjects-service"],"pid":62767,"message":"Unable to retrieve version information from Elasticsearch nodes."}

I tried to google it, but no solution worked for me.

my kibana.yaml:

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: "[my public AWS instance ip:9200]"

my elasticsearch.yaml:

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: "[my private AWS instance ip]"
cluster.initial_master_nodes: "[my private AWS instance ip]"

Update:

If I'm changing this line in kibana.yaml file to:

elasticsearch.hosts: "http://localhost:9200"

Then it works. what is the root cause? why it can't access elastic public IP but only local?



Solution 1:[1]

also:

When installing the Elastic Stack, you must use the same version across the entire stack. For example, if you are using Elasticsearch 7.9.3, you install Beats 7.9.3, APM Server 7.9.3, Elasticsearch Hadoop 7.9.3, Kibana 7.9.3, and Logstash 7.9.3.

Solution 2:[2]

Using docker, I had to specify the elasticsearch.hosts as an environment variable: -e "ELASTICSEARCH_HOSTS=http://localhost:9200", so:

docker run -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://localhost:9200" arm64v8/kibana:7.16.3

Solution 3:[3]

Set elasticsearch.hosts ipaddress as local system's host ipaddress in kibana.yml file. Also you need to mount local kibana.yml file while running docker container.

docker run -d --name kibana -p 5601:5601 -v /home/users/mySystemUserName/config/kibana.yml:/opt/kibana/config/kibana.yml kibana:7.16.3

Add the below configs in

kibana.yml

server.name: kibana
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: [ "http://192.168.0.102:9200" ]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tilu Capetine
Solution 2 Preston
Solution 3 Kranti123