I installed td-agent on GCP VM, checked that the service ran (through "systemctl status td-agent"). Then I ran "/usr/sbin/td-agent-gem install fluent-plugin-google-cloud" to install stackdriver output plugin. The installation succeeded but td-agent did not work anymore after restart. systemctl status td-agent showed:
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)
The same worked OK on VMWARE VM.
Any known reason why it fails on GCP?
Finally I found that installation of google-cloud plugin did not add it to td-agent plugin dir, so it was not loaded during startup.
The plugin was placed to /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-google-cloud-0.7.22/lib/fluent/plugin dir, so I added this dir after -p switch to ExecStart command in /usr/lib/systemd/system/td-agent.service and the plugin was loaded and worked as expected.