1

我有一些奇怪的问题filebeat

我正在使用云形成来运行我的堆栈,我正在安装和运行其中的一部分以filebeat进行日志聚合,

我将其/etc/filebeat/filebeat.yml注入机器,然后我需要重新启动filebeat

问题是filebeat挂起。并且整个配置被卡住了(请注意,如果我 ssh 进入机器并发出“sudo service filebeat restart我自己,整个配置将变得不卡住并继续)。我尝试通过cloudformation::init的services部分和部分重新启动它,它们都commands悬挂。

我还没有尝试过,userdata但那是最糟糕的解决方案。

任何想法为什么?

模板的片段。如前所述,这两个都挂起。

"commands" : {
          "01" : {
            "command" : "sudo service filebeat restart",
            "cwd" : "~",
            "ignoreErrors" : "false"
          }
}
"services" : {
          "sysvinit" : {
            "filebeat" : {
              "enabled" : "true",
              "ensureRunning" : "true",
              "files" : ["/etc/filebeat/filebeat.yml"]
            }
          }
        }
4

1 回答 1

0

好吧,这听起来确实像某种锁定。根据文档,您应该file在 filebeat 服务的 ,services部分下插入一个依赖项,这将导致您需要的 filebeat 服务重新启动。

显然,该services部分支持一个files属性:

A list of files. If cfn-init changes one directly via the files block, this service will be restarted.

于 2016-01-21T18:45:00.930 回答