我刚刚升级到 mongodb 4.4.1,控制台每隔一秒就会充斥着这些消息:
D, [2020-11-03T03:28:32.885772 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.875739 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone' [awaited].
D, [2020-11-03T03:28:42.876668 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.888517 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone'.
Run Code Online (Sandbox Code Playgroud)
任何人都知道为什么会发生这种情况,如果很糟糕,以及如何停止?
我最近在 Rails 6 应用程序中遇到了类似的行为,该应用程序使用 Mongoid 7.1 连接到独立(非集群)MongoDB 4.4 实例。下面做了一个很大的假设,即您也在使用 Mongoid 的 Rails 应用程序的上下文中看到了这种行为。
\n这种过多日志记录的原因似乎是 Mongoid 所依赖的 MongoDB Ruby 驱动程序版本。具体来说,MongoDB Ruby 驱动程序中的默认日志记录级别设置为Debug
. 当与Rails 和 Mongoid 的默认日志记录行为结合使用时,这会导致非生产环境中 MongoDb 拓扑事件的过多日志记录。有关更多详细信息,请参阅下面的公共 MongoDB Jira 票证。
https://jira.mongodb.org/browse/RUBY-2419
\nhttps://jira.mongodb.org/browse/RUBY-2356
\nMongoDB Ruby 驱动程序 2.14 版引入了一个修复程序,将默认日志记录级别设置为info
. 这个驱动程序版本本身后来被引入到 Mongoid 中。
升级应用程序中使用的 Mongoid 版本似乎已经解决了这个问题。
\n 归档时间: |
|
查看次数: |
839 次 |
最近记录: |