Preventing Duplicate Logs in OpenSearch When Tailing the Same Log File from Multiple Fluentd Servers over NFS #4683
-
What is a problem?Hello, I'm currently working on setting up log collection and indexing for my application, and I've run into a challenge that I'm hoping to get some advice on. Environment Setup:I have three Fluentd servers running in parallel. The Problem:When I configure each Fluentd server to tail the log file from the NFS mount and use a shared pos_file (position file) also on the NFS mount, I'm encountering an issue where each log entry is sent to OpenSearch three times—once from each Fluentd server. This results in duplicate entries in OpenSearch, which is not ideal. What I've Observed:
What I'm Trying to Achieve:
Questions for the Community:
Considerations:
Possible Solutions I'm Considering:
Any advice, recommendations, or insights would be greatly appreciated! Thank you in advance for your help! Describe the configuration of FluentdCurrent Fluentd Configuration: Here's a simplified version of my Fluentd configuration on each server:
Describe the logs of FluentdNo response Environment- Fluentd version: fluentd 1.16.3
- Fluent Package version: fluent-package 5.0.2
- Operating system:
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
- Kernel version: 5.4.0-173-generic |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
pos_file should not be shared. Is it for fault tolerance to use multiple instances to tail the same file? |
Beta Was this translation helpful? Give feedback.
I see.
It is not assumed to run multiple Fluentd for fault tolerance.
The single instance has some degree of fault tolerance.