我想从一个容器运行my_service
到另一个运行ELK
堆栈与syslog
驱动程序(所以我需要安装logstash-input-syslog
插件)发送日志。系统日志驱动不与码头工作组合和麋鹿堆栈
我调整this elk image(和标记它作为elk-custom
)通过以下Dockerfile-elk
(使用端口514
因为this seems to be the default port)
FROM sebp/elk
WORKDIR /opt/logstash/bin
RUN ./logstash-plugin install logstash-input-syslog
EXPOSE 514
通过docker-compose
运行我的服务如下或多或少:
elk-custom:
# image: elk-custom
build:
context: .
dockerfile: Dockerfile-elk
ports:
- 5601:5601
- 9200:9200
- 5044:5044
- 514:514
my_service:
image: some_image_from_my_local_registry
depends_on:
- elk-custom
logging:
driver: syslog
options:
syslog-address: "tcp://elk-custom:514"
但是:
ERROR: for b4cd17dc1142_namespace_my_service_1 Cannot start service my_service: failed to initialize logging driver: dial tcp: lookup elk-custom on 10.14.1.31:53: server misbehaving
ERROR: for api Cannot start service my_service: failed to initialize logging driver: dial tcp: lookup elk-custom on 10.14.1.31:53: server misbehaving ERROR: Encountered errors while bringing up the project.
有什么建议吗?
UPDATE:显然,似乎没有任何从容器内的监听端口514
,事业,命令netstat -a
显示此端口上没有什么....不知道为什么......
尝试更改'tcp:// elk-custom:514'到'tcp://127.0.0.1:514',看看是否有帮助 –
是的。这似乎做的工作...我的服务堆现在似乎开始...进一步的logstash配置 – pkaramol