首页 > 解决方案 > Logstash Google Pubsub Input Plugin 无法加载文件和拉取消息

问题描述

尝试使用在我的生产环境中运行的 docker 容器上使用google_pubsub的配置运行 Logstash 管道时出现此错误:

2021-09-16 19:13:25 FATAL runner:135 - The given configuration is invalid. Reason: Unable to configure plugins: (PluginLoadingError) Couldn't find any input plugin named 'google_pubsub'. Are you sure this is correct? Trying to load the google_pubsub input plugin resulted in this error: Problems loading the requested plugin named google_pubsub of type input. Error: RuntimeError

    you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command

no such file to load -- com/google/cloud/google-cloud-pubsub/1.37.1/google-cloud-pubsub-1.37.1 (LoadError)
2021-09-16 19:13:25 ERROR Logstash:96 - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

这似乎在重新安装插件时随机发生。我认为这是代理问题,但我在白名单中启用了 google 域。可能是错误的/缺少的东西。尽管如此,并没有解释随机故障。

此外,当我在我的机器上运行管道时,我会收到 GCP 事件,但是当我在 VM 上执行此操作时 - 不会提取任何 Pubsub 消息。会不会是防火墙规则阻止了它们?

标签: google-cloud-platformlogstashgoogle-cloud-pubsub

解决方案


错误消息表明加载“google_pubsub”输入插件时出现问题。此错误通常发生在输入 Pub/Sub 插件未正确安装时。请确保您正确安装了适用于 Pub/Sub 的Logstash 插件

例如,在 VM 中为 Pub/Sub 安装 Logstash 插件:

sudo -u root sudo -u logstash bin/logstash-plugin install logstash-input-google_pubsub

有关详细演示,请参阅社区教程。


推荐阅读