我希望将日志从一个rancher服务(例如my_service)发送到另一个运行带有syslog驱动程序的ELK堆栈的rancher服务
我通过docker-compose设置我的堆栈,大致如下:
elk-custom:
# image: elk-custom
build:
context: .
dockerfile: Dockerfile-elk
ports:
- 5601:5601
- 9200:9200
- 5044:5044
- 5151:5151
- 5152:5152
my_service:
image: some_image_from_my_local_registry
depends_on:
- elk-custom
logging:
driver: syslog
options:
syslog-address: "tcp://elk-custom:514"但是,在堆栈仪表板上,对于my_service,我得到:
my_service (Expected state running but got error: Error response from daemon: failed to initialize logging driver: dial tcp: lookup elk-custom on 10.0.2.3:53: server misbehaving)为了使特定的日志记录(elk-custom)服务可被发现,还需要其他什么东西吗?
发布于 2017-09-28 07:13:43
那里正在发生的一些事情是有问题的。首先,如果你正在进行构建,你必须使用git或者HTTP remote url或者基于s3的上下文。
请参阅文档:http://rancher.com/docs/rancher/v1.6/en/cattle/rancher-compose/#builds
通常,您构建一个映像并将其部署为服务。构建更多的是开发,在生产方面使用较少。
下一件事是,在多主机设置中,您将在Rancher网络上遇到路由问题。我建议在syslog入口处于主机网络模式的所有节点上部署Logstash收集器。然后,可以将日志记录驱动程序指向localhost syslog目标。然后,每个logstash收集器将转发到另一个logstash进行过滤或弹性集群。
https://stackoverflow.com/questions/46445609
复制相似问题