2017-12-05 6 views
0

Docker Swarm 모드에서 ELK를 설치하려고합니다.Docker Swarm에서 IP에 대한 참조를 대체하는 방법

그러면 logstash에 로그를 보내도록 filebeat에 알려야합니다. ...

#=========================== 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이며, 스웜 모드에서 떼 컨테이너를 설치할 위치를 결정하지 않으며, 그래서 나는 조금 여기에 갇혔어요 : 여기

내 filebeat 설정 파일입니다

어떤 아이디어 ???

답변

2

웜 모드에서 검색은 ne --name 매개 변수를 통해 작동합니다. 따라서 --name logstash과 함께 logstash를 배포하면 다른 서비스에서는 logstash이라는 이름을 사용하여 액세스 할 수 있습니다. 하지만, 그들은 진입하지 않는 동일한 네트워크에 있어야합니다. 새 오버레이 네트워크를 아직 만들지 않은 경우 새로 만들고 오버롤 네트워크에 모든 서비스를 할당하십시오.

+0

예, 동일한 네트워크에 있습니다. 스택에 서비스를 만들 때 서비스 이름 앞에 stak 이름이 붙어 있으므로 서비스 이름은 : logstash_logstash입니다. logstash와 logstas_stash 솔기가 모두 작동합니다. 왜 그런지 알아? –

+0

당신은 자루에 의해 추가 된 접두어를 의미합니까? 나는 그것이 단지 정의라고 생각한다. 그리고 이것을 사용하여 쉽게 녹색 파란 배치를 만들 수 있습니다. 새 스택이 이전 스택과 간섭하지 않도록 모든 스택을 새 스택 이름으로 다시 배포하면됩니다. 모든 것이 제대로 실행되면 리버스 프록시 설정과 벌금을 업데이트하십시오. 가동 중단없이 업데이트 됨 – Markus