如何限制mongodb主从同步的带宽使用
有没有办法限制mongodb主从同步的带宽使用。
我们遇到的问题是开启 mongodb 主从同步时带宽耗尽。
多谢。
Is there a way to limit bandwidth usage for mongodb master-slave sync.
The problem we've got is running out bandwidth when turn on mongodb master-slave sync.
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我的理解,即使你的延迟很低,比如< 10 毫秒,这可能会影响您的查询,具体取决于您所加载的数据类型。
此外,您还会向系统添加另一个故障点,应用程序服务器和数据库服务器之间的通信可能会失败。 MongoDB 在其协议上不使用任何加密,并且您的数据将在许多跃点之间清晰运行,除非您以某种方式对其进行隧道传输。而且,正如您所指出的,还有带宽的使用。
总的来说,我建议您使用另一个节点来运行数据库,但位于应用程序服务器的同一网络中。
As far as my understanding, even if you get low(ish) latency like < 10 ms, that can impact on your queries depending on the type of data load you have.
Also you end adding another point of failure to your system, communication between your application servers and database servers may fail. MongoDB doesn't use any encryption on it's protocol and your data will be running clear between many hops unless you tunnel it some way. And, as you pointed, there's the bandwidth use.
Overall I suggest you to get another node to run your DB, but at the same network of your application server.
事实并非如此,数据是通过 oplog 复制的,oplog 只是主数据库中的一个集合。因此,辅助设备正在有效地从主设备读取数据并下拉数据。
MongoDB 中没有可用的压缩。
从带宽的角度来看,假设所有进入主节点的内容也将进入辅助节点。您的网络硬件需要能够处理此流量。
Not really, data is replicated via the oplog which is just a collection in the primary. So the secondary is effectively reading from the primary and pulling down data.
There's no compression available within MongoDB.
From a bandwidth persepective assume that everything going to the primary is going to the secondary as well. Your network hardware will need to be able to handle this traffic.