I am running Logstash with ELK stack but after some time running it just stops, besides, when connecting with Logback from Spring Bot application it always gives me:
> -WARN in net.logstash.logback.appender.LogstashTcpSocketAppender[STASH] - Log destination localhost:25827: connection failed. java.net.ConnectException: Connection refused: connect > at java.net.ConnectException: Connection refused: connect > at at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) > at at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) > at at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) > at at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) > at at java.net.AbstractPlainSocketImpl.connect(Unknown Source) > at at java.net.PlainSocketImpl.connect(Unknown Source) > at at java.net.SocksSocketImpl.connect(Unknown Source) > at at java.net.Socket.connect(Unknown Source) > at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.openSocket(AbstractLogstashTcpSocketAppender.java:717) > at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.onStart(AbstractLogstashTcpSocketAppender.java:637) > at at net.logstash.logback.appender.AsyncDisruptorAppender$EventClearingEventHandler.onStart(AsyncDisruptorAppender.java:351) > at at net.logstash.logback.encoder.com.lmax.disruptor.BatchEventProcessor.notifyStart(BatchEventProcessor.java:224) > at at net.logstash.logback.encoder.com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:120) > at at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) > at at java.util.concurrent.FutureTask.run(Unknown Source) > at at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) > at at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) > at at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) > at at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at at java.lang.Thread.run(Unknown Source)
Any tip how to set logstash with docker-compose? And, of course, why it´s not connecting from my Spring Boot application?
> a525693f8d95 docker.elastic.co/logstash/logstash:7.5.2 "/usr/local/bin/dock…" 17 hours ago Exited (0) 18 minutes ago logstash
> 4b220eb79944 docker.elastic.co/kibana/kibana:7.5.2 "/usr/local/bin/dumb…" 17 hours ago Up 38 minutes 0.0.0.0:5601->5601/tcp kibana
> 0be9aa4f2262 docker.elastic.co/elasticsearch/elasticsearch:7.5.2 "/usr/local/bin/dock…" 17 hours ago Up 38 minutes 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elasticsearch
The docker-compose.yml:
version: '3.7'
services:
elasticsearch:
container_name: elasticsearch
hostname: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:${VERSAO_ELK}
ports:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
ELASTIC_PASSWORD: changeme
discovery.type: single-node
bootstrap.memory_lock: "true"
ulimits:
memlock:
soft: -1
hard: -1
networks:
- m2g_network
volumes:
- esdata1:/usr/share/elasticsearch/data
kibana:
container_name: kibana
hostname: kibana
image: docker.elastic.co/kibana/kibana:${VERSAO_ELK}
ports:
- "5601:5601"
networks:
- m2g_network
logstash:
container_name: logstash
image: docker.elastic.co/logstash/logstash:${VERSAO_ELK}
command: logstash -f /logstash/pipeline/logstash.conf
ports:
- "5600:5600"
- "9600:25827"
environment:
LS_JAVA_OPTS: "-Xmx512m -Xms512m"
networks:
- m2g_network
depends_on:
- elasticsearch
volumes:
esdata1:
driver: local
networks:
m2g_network:
driver: overlay