Search code examples
dockerelasticsearchdocker-composelogstashkibana

Logstash not responding at container image of kibana and logstash


I am doing a POC at elasticsearch Kibana where I am trying to register my GCS(Google Cloud Storage) for log archiving

For same I am attempting to have a container at Docker Desktop of Elasticsearch and Kibana

For this I am using the below docker compose file

services:
  elasticsearch:
    image: elasticsearch:8.12.0
    ports:
      - '9200:9200'
    environment:
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard:   -1
  kibana:
    image: kibana:8.12.0
    ports:
      - '5601:5601'

Issue:

My logstash is unresponsive at http://localhost:9200/. As per documentation I should have received a json response at this URL. Kindly suggest where I could be going wrong

I have got my Kibana up on the exposed port enter image description here But my logstash is not getting up. Logstash not responding It is showing proper metrics though at Docker Desktop enter image description here

enter image description here


Solution

  • It looks like there is misunderstanding the names of some products. I am sharing the details of main Elastic Stack products as follows.

    1. Elasticsearch: Distributed search and analytics engine. Elasticsearch use port 9200 by default.
    2. Kibana: Data visualization tool for Elasticsearch. Kibana uses port 5601 by default.
    3. Logstash: Data processing pipeline for ingesting and transforming diverse data into Elasticsearch and more. Logstash uses port 9600 by default.

    From your question I assume that you're talking about elasticsearch that runs port 9200 as default. According to the image that you shared from kibana it's working fine. Looks like you are trying to access elasticsearch with port 9200 but without HTTPS so try like the following. https://localhost:9200.

    To fix the problem, you can create an enrollment token with the following command and paste the json into kibana, after that elastic will configure itself automatically.

    docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
    

    once kibana configured you can use the following command to reset elastic password and login.

    docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
    

    For more information check this article: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html