[英]How should I replace a reference to an IP in Docker Swarm
我正在尝试以Docker Swarm模式安装ELK。
然后,我需要告诉filebeat将日志发送到logstash。
这是我的文件拍配置文件:
#=========================== Filebeat prospectors =============================
## Each - is a prospector. Most options can be set at the prospector level, so
## you can use different prospectors for various configurations.
## Below are the prospector specific configurations.
filebeat.prospectors:
- input_type: log
enabled: true
paths:
{% for log in in_filebeat_dict.filebeat.logs | default([]) %}
- {{ log }}
{% endfor %}
#================================ Outputs =====================================
# Configure what output to use when sending the data collected by the beat.
output.logstash:
hosts: ["{{ in_filebeat_dict.filebeat.output.logstash }}:{{ in_filebeat_dict.filebeat.output.port}}"]
但是in_filebeat_dict.filebeat.output.logstash
是IP,在Swarm模式下,Swarm不会决定将容器安装在何处,因此我在这里有点卡住了...
有任何想法吗 ???
在群模式下,发现适用于ne --name
参数。 因此,当使用--name logstash
部署logstash时,其他服务可以通过调用名字logstash
来访问它。 但是请记住,它们必须位于非入口的同一网络中。 如果尚未创建新的覆盖网络,请为其分配所有服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.