在牧场主上有问题(记录)服务发现

时间:2017-09-27 10:31:45

标签: docker docker-compose syslog rancher

我想将一个rancher服务(例如my_service)的日志发送到另一个运行rancher堆栈并使用ELK驱动程序的syslog服务

我正在通过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)服务可被发现?

1 个答案:

答案 0 :(得分:0)

有些事情正在发生,这是有问题的。首先,如果您正在进行构建,则必须使用git或HTTP远程URL或基于s3的上下文。

请参阅文档:http://rancher.com/docs/rancher/v1.6/en/cattle/rancher-compose/#builds

通常,您构建映像并将其部署为服务。构建更多的是开发,而不是在生产方面使用。

接下来是在多主机设置中,您将无法在Rancher网络上进行路由。我建议在主机网络模式下使用syslog ingress在所有节点上部署Logstash收集器。然后,您可以将日志记录驱动程序指向localhost syslog目标。然后,每个logstash收集器将转发到另一个用于过滤的logstash或Elastic cluster。

相关问题