HaroldChen
V2EX  ›  DevOps

如何处理多服务器下挂载 NFS 的日志收集重复问题?

  •  1
     
  •   HaroldChen · May 16, 2019 · 4267 views
    This topic created in 2573 days ago, the information mentioned may be changed or developed.

    背景: 使用 Filebeat 作为日志收集端,之前是每台 web 服务器放一份代码,业务日志写在代码目录中的 logs 目录。

    例如:代码放在 /xx/code , 需要收集的日志在 /xx/code/logs/

    现在准备让所有 web 服务器挂载同一个存放代码的 NFS 这种方式来发布代码。

    问题: 我的理解:如果是同一个 NFS,多台机器上的程序写入的日志必然也会写入同一个文件,这样每一台服务器的 filebeat 端都会收集一次新写入的日志。会出现大量重复日志的现象。

    碰到这种情况一般如何思考及解决?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3196 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 5414617a · 37ms · UTC 13:11 · PVG 21:11 · LAX 06:11 · JFK 09:11
    ♥ Do have faith in what you're doing.