AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

db.printSecondaryReplicationInfo()(mongoshメソッド)

db.printSecondaryReplicationInfo()

レプリカセットの状態を、セットの セカンダリ メンバーから見た レプリカセット の状態を形式化されたレポートで出力します。出力はrs.printSecondaryReplicationInfo()メソッドと同じです。

このメソッドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas はクラウドでの MongoDB 配置のための完全管理サービスです

重要

このコマンドは、M0 および Flex クラスターではサポートされていません。詳細については、サポートされていないコマンド を参照してください。

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

Example db.printSecondaryReplicationInfo() output when run on a replica set with two secondary members:

source: m1.example.net:27002
{
syncedTo: 'Mon Mar 01 2021 16:30:50 GMT-0800 (PST)',
replLag: '0 secs (0 hrs) behind the primary '
}
---
source: m2.example.net:27003
{
syncedTo: 'Mon Mar 01 2021 16:30:50 GMT-0800 (PST)',
replLag: '0 secs (0 hrs) behind the primary '
}

プライマリの非アクティブ期間が members[n].secondaryDelaySecs の値より大きい場合、遅延ノードはプライマリより 0 秒遅れて表示されることがあります。

A member may show a negative time value behind the primary when db.printSecondaryReplicationInfo() is run. This is expected if db.printSecondaryReplicationInfo() is run after a secondary replicates a write that follows a period of inactivity, but before the secondary receives a heartbeat from the primary with the latest optime.

注意

セカンダリ によって報告されるラグは、クラスターの健全性を反映していない場合があります。 負の値は、セカンダリがプライマリよりも進んでいることを示すものではありません。

To obtain the most current status for your replica set, run db.printSecondaryReplicationInfo() on the primary.