我想從一個容器運行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