td-agent 在 GCP 上的 fluent-plugin-google-cloud 时不起作用



>我在GCP VM上安装了td-agent,检查了服务是否运行(通过"systemctl status td-agent"(。 然后我运行"/usr/sbin/td-agent-gem install fluent-plugin-google-cloud"来安装stackdriver输出插件。安装成功,但重新启动后 td-agent 不再工作。 系统CTL状态TD代理显示:

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 上失败的任何已知原因?

最后我发现谷歌云插件的安装并没有将其添加到 td-agent 插件目录中,因此在启动过程中没有加载。

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

最新更新