C100DBA MongoDB 讲解-advantage of having delayed replica set member?
What is the principal advantage of having a delayed replica set member?
- It allows the load on the secondary severs to be more evenly spread
- It allows you to perform queries against historical versions of data
- It increases write speed to the primary
- It makes it easier to upgrade the system without downtime
- It provides a window of time to recover from operator error
翻译为:
部署一个有延迟的replica set member复制集成员的主要好处是什么?
- 其允许二级服务器上的负载能够被均衡覆盖
- 其允许用户查询历史版本的数据 , (注解:其实就相当于是延迟的dataguard standby ,可以查到过去某个时间点的数据)
- 其帮助primary节点提供写入的速度
- 其帮助系统升级而无需宕机时间更简单方便
- 其为操作错误后的恢复提供了一个时间窗口
显然答案是B 其允许用户查询历史版本的数据。
delayed replica set member的配置方法:
z
cfg = rs.conf() cfg.members[0].priority = 0 cfg.members[0].hidden = true cfg.members[0].slaveDelay = 3600 rs.reconfig(cfg)
详见 官方文档http://docs.mongodb.org/manual/tutorial/configure-a-delayed-replica-set-member/
主要参数为slaveDelay ,注意slaveDelay的长度必须小于oplog的窗口,如果oplog要比slaveDelay时间短,则延迟的成员将无法成功复制操作。
Because delayed members are a “rolling backup” or a running “historical” snapshot of the data set, they may help you recover from various kinds of human error. For example, a delayed member can make it possible to recover from unsuccessful application upgrades and operator errors including dropped databases and collections.
由于延迟节点是一个 “滚动的备份” 或一个保持着历史快照的数据集, 所以他们可以帮助你从各种人为故障中恢复出数据。 例如如果一个不成功的应用升级或其他操作失误(例如误drop database或collection)时,你可以直接从延迟节点中抽取数据来恢复。
Leave a Reply