google-cloud-platform - 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_pubsub”输入插件时出现问题。此错误通常发生在输入 Pub/Sub 插件未正确安装时。请确保您正确安装了适用于 Pub/Sub 的Logstash 插件。
例如,在 VM 中为 Pub/Sub 安装 Logstash 插件:
sudo -u root sudo -u logstash bin/logstash-plugin install logstash-input-google_pubsub
有关详细演示,请参阅此社区教程。
推荐阅读
- python - 无法将 PostgreSQL 数据库从 docker 连接到 python
- c# - 在没有原则的线程上使用 Authorize 属性时,Asp.net Core 操作不返回 401?
- swift - 无法使用 Fairplay HLS 从 AVPlayer 获取视频缩略图
- reporting-services - 在 SSRS 中,预览上的日期时间参数与部署的报告不匹配
- node.js - 由于“错误:‘class v8::ObjectTemplate’没有名为‘SetAccessCheckCallbacks’的成员”,npm 安装失败
- heroku - 在 Heroku 中使用带有 HTTP2 支持的 actix-web
- ios - 我的位置没有显示在 MapKit 的地图上
- javascript - 如何从对象数组中提取特定数据并将其发布到 Firebase
- flutter - SimpleDialog Flutter 中的 Snackbar
- jenkins - 如何限制詹金斯的“存档工件”最大尺寸?