Why Kibana cannot fetch indices from ES in docker?

I have run isolated containers for ES and Kibana and exposed their ports in to the host machine. When I run Kibana it can connect to ES:9200:

{"type":"log","@timestamp":"2018-05-19T10:05:24Z","tags":["status","plugin:elasticsearch@6.2.4","info"],"pid":1,"state":"green","message":"Status changed from red to green - Ready","prevState":"red","prevMsg":"Unable to connect to Elasticsearch at http://172.16.132.12:9200."}

It reports that I could not connect to 9200 port but when I started ES container. It turned from red to green state.

When I check count of documents for a specific index it reports that it's increasing, so data is being imported into ES:

curl http://localhost:9200/_cat/indices/lgg-20180519?v

health status index           uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open      lgg-20180519 UIya79T-TMadxZMJdNcIeQ   5   1        **246**            0    412.1kb        412.1kb

Count of documents is 246 and goes up.

Now when I go to Kibana dashboard and use devTools to list indices by command GET _cat/indices, it reports that it just only has:

yellow open .kibana dyQy2N7TRa-1TMtjgXu8KQ 1 1 1 0 3.6kb 3.6kb

But I'm almost sure that indices are much more than that, As I have issued a command to list indices. What is happening and why data is not listed in Kabana?

Sample document in ES for lgg-20180519is like below:

 {
        "_index" : "lgg-20180519",
        "_type" : "lgg",
        "_id" : "uPrpd2MBGspCRkmTPSrj",
        "_score" : 1.0,
        "_source" : {
          "container_id" : "fe5e95b40050f793f224bf87ee8fa5c8b34c04aae4a823021e3e02fe1b6c1d8e",
          "container_name" : "/dev_lgg.1.mk5dcm444o3zfc8sjuefafgu5",
          "source" : "stderr",
          "log" : "2018-05.......TRUNCATED",
          "@timestamp" : "2018-05-19T10:19:00.000000000+00:00"
}

It has timestamp. It has data. I'm really frustrated with this problem. Any help would be appreciated.

The interesting thing about this is that when I use cURL to do the exact same thing as Kibana in host machine:

curl "http://localhost:5601/elasticsearch/lgg-20180519/_mapping/field/*?_=1526727164121&ignore_unavailable=false&allow_no_indices=false&include_defaults=true"

It cannot found the index either! Why is this happening. Does kibana need any other configuration other than ES host and port?

@alireza_hoseini this is almost certainly an issue with your networking configuration in Docker, and the inability for the Kibana container to communicate with Elasticsearch via that ip address and port. I'd recommend starting with ensure that you're able to execute the following curl command from the Kibana container and connect to the Elasticsearch instance curl http://{insert the elasticsearch ip here}:9200.

Thank you. Problem solved.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.