0

我在 GCP VM 上安装了 td-agent,检查了服务是否运行(通过“systemctl status td-agent”)。然后我运行“/usr/sbin/td-agent-gem install fluent-plugin-google-cloud”来安装stackdriver输出插件。安装成功,但重启后 td-agent 不再工作。systemctl status td-agent 显示:

Job for td-agent.service failed because the control process exited with error code. See "systemctl status td-agent.service" and "journalctl -xe" for details.
[ei-platform@gw1 ~]$ sudo systemctl status td-agent.service
   td-agent.service - td-agent: Fluentd based data collector for Treasure Data
   Loaded: loaded (/usr/lib/systemd/system/td-agent.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Wed 2019-10-16 05:05:46 UTC; 5s ago
     Docs: https://docs.treasuredata.com/articles/td-agent
  Process: 32171 ExecStart=/opt/td-agent/embedded/bin/fluentd --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid $TD_AGENT_OPTIONS (code=exited, status=1/FAILURE)

在 VMWARE VM 上同样可以正常工作。

它在 GCP 上失败的任何已知原因?

4

1 回答 1

0

最后发现google-cloud插件的安装并没有将其添加到td-agent插件目录中,所以启动时没有加载。

该插件被放置到 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-google-cloud-0.7.22/lib/fluent/plugin 目录,所以我添加了这个目录在 -p 切换到 /usr/lib/systemd/system/td-agent.service 中的 ExecStart 命令后,插件已加载并按预期工作。

于 2019-10-24T12:44:27.113 回答