How to check secondary is synced now or not

后端 未结 4 647
深忆病人
深忆病人 2021-02-01 04:12

there is the replica with three member (primary,secondary,secondary). Suppose one of secondaries down for a day, after return secondary back to replica how can i find, i

4条回答
  •  天涯浪人
    2021-02-01 04:46

    @arcseldon gave the right answer, however, rs.printSlaveReplicationInfo() will be depricated soon

    rs0:PRIMARY> rs.printSlaveReplicationInfo() WARNING: printSlaveReplicationInfo is deprecated and may be removed in the next major release. Please use printSecondaryReplicationInfo instead.

    So, start using rs.printSecondaryReplicationInfo() instead

    rs0:PRIMARY> rs.printSecondaryReplicationInfo()
    source: mongo-1.mongo.ns.svc.cluster.local:27017
            syncedTo: Sat Sep 26 2020 01:26:32 GMT+0000 (UTC)
            10 secs (0 hrs) behind the primary 
    source: mongo-2.mongo.ns.svc.cluster.local:27017
            syncedTo: Sat Sep 26 2020 01:26:32 GMT+0000 (UTC)
            10 secs (0 hrs) behind the primary 
    

提交回复
热议问题