Hello,
I'm running a ElasticStack using a docker compose. The errors in logstash are:
[2025-04-08T17:04:18,301][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::SocketException] Connect to elasticsearch:9200 [elasticsearch/172.19.0.2] failed: Connection refused"}
[2025-04-08T17:04:48,367][ERROR][logstash.licensechecker.licensereader] Unable to retrieve Elasticsearch cluster info. {:message=>"No Available connections", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError}
My understanding is that if everything is running ok I would see my index todo-fastapi-k8s-logs
running while I do:
curl -X GET "http://localhost:9200/_cat/indices?v"
Result:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .kibana-observability-ai-assistant-conversations-000001 BwitWGLgQfSEEYZBOBHRwQ 1 0 0 0 248b 248b
green open .kibana-observability-ai-assistant-kb-000001 JtpdFBTdRQqyOBYtwhjYAw 1 0 0 0 248b 248b
My docker-compose.yml is:
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- "9200:9200"
logstash:
image: docker.elastic.co/logstash/logstash:8.10.2
container_name: logstash
ports:
- "5044:5044"
volumes:
- ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf
depends_on:
- elasticsearch
kibana:
image: docker.elastic.co/kibana/kibana:8.10.2
container_name: kibana
ports:
- "5601:5601"
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
depends_on:
- elasticsearch
My logstash.conf is:
input {
file {
path => "/home/gabriel/repos/todo-fastapi-k8s/todo-fastapi-k8s.log"
start_position => "beginning"
codec => json
}
}
filter {
}
output {
elasticsearch {
hosts => ["http://elasticsearch:9200"]
index => "todo-fastapi-k8s-logs"
}
stdout { codec => rubydebug }
}
I got the following output if I run the commands curl http://localhost:9200
and docker exec -it logstash curl http://elasticsearch:9200
:
{
"name" : "768dc955af03",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "5ePn2zoqRS60NmuqCCKUIQ",
"version" : {
"number" : "8.10.2",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "6d20dd8ce62365be9b1aca96427de4622e970e9e",
"build_date" : "2023-09-19T08:16:24.564900370Z",
"build_snapshot" : false,
"lucene_version" : "9.7.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
Any idea or help?