定義
replSetGetStatusreplSetGetStatusコマンドは、コマンドを処理したサーバーの観点からレプリカセットのステータスを返します。replSetGetStatusは、管理データベースで実行する必要があります。The
mongodinstance must be a replica set member forreplSetGetStatusto return successfully.このコマンドによって提供されるデータは、レプリカセットの他のノードによってサーバーに送信されるハートビートに含まれるデータから派生します。ハートビートの頻度により、これらのデータは数秒古くなる可能性があります。
Tip
In
mongosh, this command can also be run through thers.status()helper method.Helper methods are convenient for
mongoshusers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
- MongoDB Atlas はクラウドでの MongoDB 配置のための完全管理サービスです
重要
このコマンドは、M0 および Flex クラスターではサポートされていません。詳細については、サポートされていないコマンド を参照してください。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
このコマンドの構文は、次のとおりです。
db.adminCommand( { replSetGetStatus: 1 } )
If you run replSetGetStatus or the mongosh helper rs.status() on a member during its initial sync in the STARTUP2 state, the command returns replSetGetStatus.initialSyncStatus metrics.
After the member completes the initial synchronization and transitions to another state, the replSetGetStatus.initialSyncStatus metrics are no longer available.
例
The following example runs the replSetGetStatus command on the admin database of the replica set primary:
db.adminCommand( { replSetGetStatus: 1 } )
このコマンドは、レプリカセット プライマリの例に対して次の出力を返します。
{ "set" : "replset", "date" : ISODate("2024-08-15T23:06:13.978Z"), "myState" : 1, "term" : Long(3), "syncSourceHost" : "", "syncSourceId" : -1, "heartbeatIntervalMillis" : Long(2000), "majorityVoteCount" : 2, "writeMajorityCount" : 2, "votingMembersCount" : 3, "writableVotingMembersCount" : 3, "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "lastCommittedWallTime" : ISODate("2024-08-15T23:06:13.978Z"), "readConcernMajorityOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "appliedOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "durableOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "lastAppliedWallTime" : ISODate("2020-03-05T05:24:38.122Z"), "lastDurableWallTime" : ISODate("2020-03-05T05:24:38.122Z") }, "lastStableRecoveryTimestamp" : Timestamp(1723763173, 1), "electionCandidateMetrics" : { "lastElectionReason" : "stepUpRequestSkipDryRun", "lastElectionDate" : ISODate("2024-08-15T23:06:13.978Z"), "electionTerm" : Long(3), "lastCommittedOpTimeAtElection" : { "ts" : Timestamp(1723763173, 1), "t" : Long(2) }, "lastSeenOpTimeAtElection" : { "ts" : Timestamp(1723763173, 1), "t" : Long(2) }, "numVotesNeeded" : 2, "priorityAtElection" : 1, "electionTimeoutMillis" : Long(10000), "priorPrimaryMemberId" : 1, "numCatchUpOps" : Long(0), "newTermStartDate" : ISODate("2024-08-15T23:06:13.978Z"), "wMajorityWriteAvailabilityDate" : ISODate("2024-08-15T23:06:13.978Z") }, "electionParticipantMetrics" : { "votedForCandidate" : true, "electionTerm" : Long(2), "lastVoteDate" : ISODate("2024-08-15T23:06:13.978Z"), "electionCandidateMemberId" : 1, "voteReason" : "", "lastAppliedOpTimeAtElection" : { "ts" : Timestamp(1723763173, 1), "t" : Long(1) }, "maxAppliedOpTimeInSet" : { "ts" : Timestamp(1723763173, 1), "t" : Long(1) }, "priorityAtElection" : 1 }, "members" : [ { "_id" : 0, "name" : "m1.example.net:27017", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 269, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "optimeWrittenDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "syncSourceHost" : "", "syncSourceId" : -1, "infoMessage" : "", "electionTime" : Timestamp(1723763173, 1), "electionDate" : ISODate("2024-08-15T23:06:13.978Z"), "configVersion" : 1, "configTerm" : 0, "self" : true, "lastHeartbeatMessage" : "" }, { "_id" : 1, "name" : "m2.example.net:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 266, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "optimeDurableDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeat" : ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeatRecv" : ISODate("2024-08-15T23:06:13.978Z"), "pingMs" : Long(0), "lastHeartbeatMessage" : "", "syncSourceHost" : "m3.example.net:27017", "syncSourceId" : 2, "infoMessage" : "", "configVersion" : 1 }, { "_id" : 2, "name" : "m3.example.net:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 266, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "optimeDurableDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeat" : ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeatRecv" : ISODate("2024-08-15T23:06:13.978Z"), "pingMs" : Long(0), "lastHeartbeatMessage" : "", "syncSourceHost" : "m1.example.net:27017", "syncSourceId" : 0, "infoMessage" : "", "configVersion" : 1 } ], "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1723763173, 1), "signature" : { "hash" : BinData(0,"9C2qcGVkipEGJW3iF90qxb/gIwc="), "keyId" : Long("6800589497806356482") } }, "operationTime" : Timestamp(1723763173, 1) }
The following example runs the replSetGetStatus command on the admin database of the replica set secondary:
db.adminCommand( { replSetGetStatus: 1 } )
このコマンドは、レプリカセット セカンダリの例に対して次の出力を返します。
{ "set" : "replset", "date" : ISODate("2024-08-15T23:06:13.978Z"), "myState" : 2, "term" : Long(3), "syncSourceHost" : "m3.example.net:27017", "syncSourceId" : 2, "heartbeatIntervalMillis" : Long(2000), "majorityVoteCount" : 2, "writeMajorityCount" : 2, "votingMembersCount" : 3, "writableVotingMembersCount" : 3, "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "lastCommittedWallTime" : ISODate("2024-08-15T23:06:13.978Z"), "readConcernMajorityOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "appliedOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "durableOpTime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "lastAppliedWallTime" : ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime" : ISODate("2024-08-15T23:06:13.978Z") }, "lastStableRecoveryTimestamp" : Timestamp(1723763173, 1), "electionParticipantMetrics" : { "votedForCandidate" : true, "electionTerm" : Long(3), "lastVoteDate" : ISODate("2024-08-15T23:06:13.978Z"), "electionCandidateMemberId" : 0, "voteReason" : "", "lastAppliedOpTimeAtElection" : { "ts" : Timestamp(1723763173, 1), "t" : Long(2) }, "maxAppliedOpTimeInSet" : { "ts" : Timestamp(1723763173, 1), "t" : Long(2) }, "priorityAtElection" : 1, "newTermStartDate" : ISODate("2024-08-15T23:06:13.978Z"), "newTermAppliedDate" : ISODate("2024-08-15T23:06:13.978Z") }, "members" : [ { "_id" : 0, "name" : "m1.example.net:27017", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 407, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "optimeDurableDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeat" : ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeatRecv" : ISODate("2024-08-15T23:06:13.978Z"), "pingMs" : Long(0), "lastHeartbeatMessage" : "", "syncSourceHost" : "", "syncSourceId" : -1, "infoMessage" : "", "electionTime" : Timestamp(1723763173, 1), "electionDate" : ISODate("2024-08-15T23:06:13.978Z"), "configVersion" : 1 }, { "_id" : 1, "name" : "m2.example.net:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 409, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "syncSourceHost" : "m3.example.net:27017", "syncSourceId" : 2, "infoMessage" : "", "configVersion" : 1, "configTerm" : 0, "self" : true, "lastHeartbeatMessage" : "" }, { "_id" : 2, "name" : "m3.example.net:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 407, "optime" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDurable" : { "ts" : Timestamp(1723763173, 1), "t" : Long(3) }, "optimeDate" : ISODate("2024-08-15T23:06:13.978Z"), "optimeDurableDate" : ISODate("2024-08-15T23:06:13.978Z"), "lastAppliedWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastDurableWallTime": ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeat" : ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeatRecv" : ISODate("2024-08-15T23:06:13.978Z"), "pingMs" : Long(0), "lastHeartbeatMessage" : "", "syncSourceHost" : "m1.example.net:27017", "syncSourceId" : 0, "infoMessage" : "", "configVersion" : 1 } ], "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1723763173, 1), "signature" : { "hash" : BinData(0,"kmhE5YARZlzn/DX4B/D0E5P6okY="), "keyId" : Long("6800589497806356482") } }, "operationTime" : Timestamp(1723763173, 1), }
- 以前のバージョン(3.6.x〜4.2.0)
You can include the optional
initialSync: 1to include thereplSetGetStatus.initialSyncStatusin the output (you can omit if you do not want to return the initial sync status):db.adminCommand( { replSetGetStatus: 1, initialSync: 1 } )
- MongoDB 5.2以降、
- the
replSetGetStatus.initialSyncStatusdocument contains additional fields when using a file copy based initial sync.
If you run replSetGetStatus on a member during its initial sync, the command returns replSetGetStatus.initialSyncStatus metrics.
db.adminCommand( { replSetGetStatus: 1 } )
After the member completes the initial synchronization and transitions to another state, the replSetGetStatus.initialSyncStatus metrics are no longer available.
次の例では、replSetGetStatus 44最初の同期中に. レプリカセットノードの管理データベース上で コマンドを実行します。
{ "set" : "replset", "date" : ISODate("2024-08-15T23:06:13.978Z") "myState" : 5, "term" : Long(1), "syncSourceHost" : "m1.example.net:27017", "syncSourceId" : 0, "heartbeatIntervalMillis" : Long(2000), "majorityVoteCount" : 2, "writeMajorityCount" : 2, "votingMembersCount" : 2, "writableVotingMembersCount" : 2, "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "lastCommittedWallTime" : ISODate("1970-01-01T00:00:00Z"), "appliedOpTime" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "durableOpTime" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "lastAppliedWallTime" : ISODate("1970-01-01T00:00:00Z"), "lastDurableWallTime" : ISODate("1970-01-01T00:00:00Z") }, "lastStableRecoveryTimestamp" : Timestamp(0, 0), "initialSyncStatus" : { "failedInitialSyncAttempts" : 0, "maxFailedInitialSyncAttempts" : 10, "initialSyncStart" : ISODate("2024-08-15T23:06:13.978Z"), "initialSyncAttempts" : [ ], "appliedOps" : 0, "initialSyncOplogStart" : Timestamp(1723763173, 1), "syncSourceUnreachableSince" : ISODate("2024-08-15T23:06:13.978Z"), "currentOutageDurationMillis" : Long(8687), "totalTimeUnreachableMillis" : Long(8687), "databases" : { "databasesCloned" : 3, "admin" : { "collections" : 4, "clonedCollections" : 4, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 429, "admin.system.roles" : { "documentsToCopy" : 22, "documentsCopied" : 22, "indexes" : 2, "fetchedBatches" : 1, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 138, "receivedBatches" : 1 }, "admin.system.users" : { "documentsToCopy" : 32, "documentsCopied" : 32, "indexes" : 2, "fetchedBatches" : 1, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 149, "receivedBatches" : 1 }, "admin.system.keys" : { "documentsToCopy" : 2, "documentsCopied" : 2, "indexes" : 1, "fetchedBatches" : 1, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 76, "receivedBatches" : 1 }, "admin.system.version" : { "documentsToCopy" : 2, "documentsCopied" : 2, "indexes" : 1, "fetchedBatches" : 1, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 66, "receivedBatches" : 1 } }, "config" : { "collections" : 2, "clonedCollections" : 2, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 198, "config.transactions" : { "documentsToCopy" : 0, "documentsCopied" : 0, "indexes" : 1, "fetchedBatches" : 0, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 74, "receivedBatches" : 0 }, "config.system.sessions" : { "documentsToCopy" : 0, "documentsCopied" : 0, "indexes" : 2, "fetchedBatches" : 0, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 124, "receivedBatches" : 0 } }, "test" : { "collections" : 1, "clonedCollections" : 1, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 47967, "test.hugeindex" : { "documentsToCopy" : 25000, "documentsCopied" : 25000, "indexes" : 2, "fetchedBatches" : 21, "start" : ISODate("2024-08-15T23:06:13.978Z"), "end" : ISODate("2024-08-15T23:06:13.978Z"), "elapsedMillis" : 47967, "receivedBatches" : 21 } } } }, "members" : [ { "_id" : 0, "name" : "m1.example.net:27017", "health" : 0, "state" : 8, "stateStr" : "(not reachable/healthy)", "uptime" : 0, "optime" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "optimeDurable" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "optimeDate" : ISODate("1970-01-01T00:00:00Z"), "optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"), "lastAppliedWallTime": ISODate("1970-01-01T00:00:00Z"), "lastDurableWallTime": ISODate("1970-01-01T00:00:00Z""), "lastHeartbeat" : ISODate("2024-08-15T23:06:13.978Z"), "lastHeartbeatRecv" : ISODate("2024-08-15T23:06:13.978Z"), "pingMs" : Long(0), "lastHeartbeatMessage" : "Error connecting to m1.example.net:27017 (127.0.0.1:27018) :: caused by :: Connection refused", "syncSourceHost" : "", "syncSourceId" : -1, "infoMessage" : "", "configVersion" : 2 }, { "_id" : 1, "name" : "m2.example.net:27017", "health" : 1, "state" : 5, "stateStr" : "STARTUP2", "uptime" : 5297, "optime" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "optimeDurable" : { "ts" : Timestamp(0, 0), "t" : Long(-1) }, "optimeDate" : ISODate("1970-01-01T00:00:00Z"), "lastAppliedWallTime": ISODate("1970-01-01T00:00:00Z"), "lastDurableWallTime": ISODate("1970-01-01T00:00:00Z"), "syncSourceHost" : "m1.example.net:27017", "syncSourceId" : 0, "infoMessage" : "", "configVersion" : 2, "configTerm" : 1, "self" : true, "lastHeartbeatMessage" : "" } ], "ok" : 1 }
出力
replSetGetStatus コマンドは、以下のフィールドを持つドキュメントを返します。
replSetGetStatus.setset値は、replSetName設定で構成されたレプリカセットの名前です。これはrs.conf()の_idと同じ値です。
replSetGetStatus.dateAn ISODate formatted date and time that contains the current time according to the server that processed the replSetGetStatus command. Compare this to the values of
replSetGetStatus.members[n].lastHeartbeatto find the operational latency between this server and the other members of the replica set.
replSetGetStatus.myState現在のノードのレプリカ状態を表す
0から10までの整数。
replSetGetStatus.termThe election count for the replica set, as known to this replica set member. The
termis used by the distributed consensus algorithm to ensure correctness.
replSetGetStatus.syncSourceHostThe
syncSourceHostfield holds the hostname of the member from which this instance syncs.If this instance is a primary,
syncSourceHostis an empty string and thesyncSourceId-1.
replSetGetStatus.syncSourceIdThe
syncSourceIdfield holds thereplSetGetStatus.members[n]._idof the member from which this instance synchronizes.If this instance is a primary,
syncSourceHostis an empty string and thesyncSourceId-1.
replSetGetStatus.writeMajorityCount書込み保証 (write concern)
"majority"を実行するに必要なデータを持つ投票ノードの数。書き込み (write) は、データを持つノードにのみ適用できます。For the calculation of
replSetGetStatus.writeMajorityCount, see Calculating Majority for Write Concern.
replSetGetStatus.votingMembersCountvotes: 1で構成されたノードの数(アービタを含む)。
replSetGetStatus.writableVotingMembersCountvotes: 1で構成されたデータを持つノードの数(これはアービタを含みません)。
replSetGetStatus.optimesoptimesフィールドは、レプリケーションの進行状況を検査するために使用されるoptimeを含むドキュメントを保持します。optimesフィールドには、さまざまな optime に対応する ISODate 形式の日付文字列が含まれています。各 optime 値は、次の内容を含むドキュメントです。
replSetGetStatus.optimes.lastCommittedWallTimeThe ISODate-formatted date string corresponding to
lastCommittedOpTime.
replSetGetStatus.optimes.readConcernMajorityOpTime読み取り保証 (read concern)
lastCommittedOpTime)"majority"クエリを満たすことができる直近の操作に関する、このノードの観点に基づく情報。これは、lastCommittedOpTime"majority"クエリを満たすことができる直近のreadConcernMajorityOpTimeです。 は より小さいか等しいです。
replSetGetStatus.optimes.lastAppliedWallTimeThe ISODate-formatted date string corresponding to
appliedOpTime.
replSetGetStatus.optimes.lastDurableWallTimeThe ISODate-formatted date string corresponding to
durableOpTime.
replSetGetStatus.electionCandidateMetricsMetrics related to the election of the current primary.
electionCandidateMetricsis only available on the primary or a candidate for election. For a candidate, the metrics are unavailable after the candidate loses the election.replSetGetStatus.electionCandidateMetrics.electionTermterm新しい選挙を呼び出した時点でのノードの選挙数( )。
replSetGetStatus.electionCandidateMetrics.lastCommittedOpTimeAtElectionThe most recent
majority-committed optime, as seen by this member, at the time it called the new election.
replSetGetStatus.electionCandidateMetrics.lastSeenOpTimeAtElectionThe member's most recent
applied optimeat the time it called the new election.
replSetGetStatus.electionCandidateMetrics.priorityAtElection選挙を呼び出した時点での、ノードの
priority。
replSetGetStatus.electionCandidateMetrics.electionTimeoutMillis選挙の時点でのレプリカセットの構成済み
electionTimeoutMillis設定。
replSetGetStatus.electionCandidateMetrics.priorPrimaryMemberId前のプライマリの
members[n]._id。前のプライマリがない場合、このフィールドは存在しません。
replSetGetStatus.electionCandidateMetrics.targetCatchupOpTime新しく選出されたプライマリのキャッチアップ プロセスのためのターゲット optime。新しく選出されたプライマリがターゲットのキャッチアップ optime に達したときのみ、書込み (write) の受け入れを開始できます。
replSetGetStatus.electionCandidateMetrics.numCatchUpOps新しく選出されたプライマリがキャッチアップ プロセスを正常に完了したときに適用された操作の数。
replSetGetStatus.electionCandidateMetrics.newTermStartDateプライマリとしてのノードのタームが開始された日時(つまり、
new termエントリが oplog に書込まれた日時)。
replSetGetStatus.electionCandidateMetrics.wMajorityWriteAvailabilityDateレプリカセットの選挙後に書込み保証 (write concern)
"majority"が使用可能になった日時(new termoplog エントリが過半数コミットされた日時)。
replSetGetStatus.electionParticipantMetricsノードが参加した最新の選挙に関連するメトリクス。
replSetGetStatus.electionParticipantMetrics.electionTermノードが参加した選挙のターム。このタームは、参加者のメトリクスに関連付けられた選挙を識別します。
replSetGetStatus.electionParticipantMetrics.lastVoteDate参加者がいつ投票したかをレコードする ISODate 形式の日付文字列。
replSetGetStatus.electionParticipantMetrics.electionCandidateMemberId選挙を呼び出した候補者の
members[n]._id。
replSetGetStatus.electionParticipantMetrics.voteReasonノードが候補者に投票しなかった場合の投票理由。ノードが候補者に投票した場合、値は空の文字列です。
replSetGetStatus.electionParticipantMetrics.lastAppliedOpTimeAtElectionこのノードの最新の選挙時点での optime。
optime 値は、タイムスタンプ(
ts)とターム(t)を含むドキュメントです。
replSetGetStatus.electionParticipantMetrics.maxAppliedOpTimeInSetこのレプリカセットの任意のノード(このノードによって認識される)に対して最後に適用された optime。
optime 値は、タイムスタンプ(
ts)とターム(t)を含むドキュメントです。
replSetGetStatus.electionParticipantMetrics.priorityAtElection選挙時点でのノードの
priority。
replSetGetStatus.electionParticipantMetrics.newTermStartDate選出されたプライマリのタームが開始された日付と時刻。これはプライマリが
new termエントリを oplog に書込んだ日時に相当し、エントリがセカンダリの oplog に追加(複製)された日時ではありません。The field is available for secondary members only. For the primary, see
replSetGetStatus.electionCandidateMetrics.newTermStartDateinstead.
replSetGetStatus.initialSyncStatusこのノードの最初の同期の進行状況とステータスに関する情報を提供するドキュメント。
重要
可用性
replSetGetStatus.initialSyncStatusmetrics are only available when run on a member during its initial sync, in theSTARTUP2state.replSetGetStatus.initialSyncStatus.failedInitialSyncAttemptsこのノードで最初の同期が失敗し、再開する必要があった回数。
replSetGetStatus.initialSyncStatus.maxFailedInitialSyncAttemptsノードがシャットダウンする前に、このノードで最初の同期を再開できる最大回数。
replSetGetStatus.initialSyncStatus.initialSyncStartこのノードの最初の同期の開始タイムスタンプ。
replSetGetStatus.initialSyncStatus.initialSyncEndこのノードの最初の同期の終了タイムスタンプ。
replSetGetStatus.initialSyncStatus.initialSyncElapsedMillisThe number of milliseconds between
initialSyncStartandinitialSyncEnd.
replSetGetStatus.initialSyncStatus.initialSyncAttempts各ドキュメントが 1 回の最初の同期の試行に対応するドキュメントの配列。例:
"initialSyncAttempts" : [ { "durationMillis" : 59539, "status" : "InvalidOptions: error fetching oplog during initial sync :: caused by :: Error while getting the next batch in the oplog fetcher :: caused by :: readConcern afterClusterTime value must not be greater than the current clusterTime. Requested clusterTime: { ts: Timestamp(0, 1) }; current clusterTime: { ts: Timestamp(0, 0) }", "syncSource" : "m1.example.net:27017", "rollBackId" : 1, "operationsRetried" : 120, "totalTimeUnreachableMillis" : 52601 } ], 各ドキュメントには、最初の同期を試行するための以下の情報が含まれています。
フィールド説明durationMillis
最初の同期試行の継続時間(ミリ秒)。
状態
最初の同期試行の終了ステータス。
syncSource
最初の同期試行の同期ソース。
rollBackId
最初の同期試行の開始時点での同期ソースのロールバック識別子。
rollBackIdは、ファイル コピー ベースの最初の同期を使用する場合は表示されません。operationsRetried
すべての操作再試行回数の合計。
totalTimeUnreachableMillis
操作の再試行に費やされた時間の合計。
See also
failedInitialSyncAttempts.
replSetGetStatus.initialSyncStatus.appliedOps最初の同期の開始後に実行され、データベースのクローン後に適用された操作の数。
最初の同期プロセスの一部として、ノードは oplog を使用して、レプリカセットの現在の状態を反映するようにデータセットを更新します。
replSetGetStatus.initialSyncStatus.initialSyncOplogStartノードが最初の同期の開始後に発生した変更を適用する最初の同期の oplog アプリケーション ステージの開始タイムスタンプ。
最初の同期プロセスの一部として、ノードは oplog を使用して、レプリカセットの現在の状態を反映するようにデータセットを更新します。
replSetGetStatus.initialSyncStatus.initialSyncOplogEndノードが最初の同期の開始後に発生した変更を適用する最初の同期の oplog アプリケーション ステージの終了タイムスタンプ。
最初の同期プロセスの一部として、ノードは oplog を使用して、レプリカセットの現在の状態を反映するようにデータセットを更新します。
replSetGetStatus.initialSyncStatus.syncSourceUnreachableSince同期ソースが到達不能になった日時。
現在の最初の同期中に同期ソースが利用不可の場合にのみ存在します。
replSetGetStatus.initialSyncStatus.currentOutageDurationMillis同期ソースが利用できなかった時間(ミリ秒単位)。
現在の最初の同期中に同期ソースが利用不可の場合にのみ存在します。
replSetGetStatus.initialSyncStatus.databases最初の同期中にクローンされたデータベースの詳細。
replSetGetStatus.initialSyncStatus.databases.databasesCloned最初の同期中にクローンされたデータベースの数。
replSetGetStatus.initialSyncStatus.databases.<dbname>各データベースについて、そのデータベースのクローン作成の進行状況に関する情報を返すドキュメント。
{ "collections" : <number of collections to clone in the database>, "clonedCollections" : <number of collections cloned to date>, "start" : <start date and time for the database clone>, "end" : <end date and time for the database clone>, "elapsedMillis" : <duration of the database clone>, "<db>.<collection>" : { "documentsToCopy" : <number of documents to copy>, "documentsCopied" : <number of documents copied to date>, "indexes" : <number of indexes>, "fetchedBatches" : <number of batches of documents fetched to date>, "start" : <start date and time for the collection clone>, "end" : <end date and time for the collection clone>, "elapsedMillis" : <duration of the collection clone>, "receivedBatches" : <number of batches of documents received to date> } }
replSetGetStatus.initialSyncStatus.methodバージョン5.2の新機能。
最初の同期に使用されるメソッド。
logicalに設定されている場合、同期は論理的な最初の同期です。fileCopyBasedに設定されている場合は、同期はファイル コピー ベースの最初の同期になります。
replSetGetStatus.initialSyncStatus.approxTotalDataSize同期されるすべてのファイルのおおよそのサイズ(バイト)。
このフィールドは、論理的またはファイル コピー ベースの最初の同期を使用する場合に表示されます。
replSetGetStatus.initialSyncStatus.approxTotalBytesCopiedすでにコピーされた合計バイト数。
このフィールドは、論理的またはファイル コピー ベースの最初の同期を使用する場合に表示されます。
replSetGetStatus.initialSyncStatus.totalInitialSyncElapsedMillis進行中の同期試行の合計経過時間。
このフィールドは、論理的またはファイル コピー ベースの最初の同期を使用する場合に表示されます。
replSetGetStatus.initialSyncStatus.remainingInitialSyncEstimatedMillis進行中の同期試行の予想残り時間。
このフィールドは、論理的またはファイル コピー ベースの最初の同期を使用する場合に表示されます。
replSetGetStatus.initialSyncStatus.initialBackupDataSize同期されるファイルの初期セットの合計サイズ(バイト)。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.previousOplogEnd前のバックアップカーソルで使用可能な optime。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.currentOplogEnd現在のバックアップカーソルで使用できることが保証されている最後の optime。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.syncSourceLastAppliedこのバックアップカーソルの開始前に同期ソースに適用された最後の更新の optime。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.numExtensions同期によって新しいバックアップカーソルが開始された回数。
バックアップカーソルが開始されていない場合、このフィールドは表示されません。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.extensionDataSize現在の拡張子の合計バイト数。
このフィールドは、進行中の拡張がない場合は表示されません。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.filesファイル コピー ベースの最初の同期中に同期されるファイルの配列。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.files[n].filePathバックアップカーソルのルートに対するファイルの相対パス。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.files[n].fileSizeバックアップカーソルによって報告されるファイルのサイズ。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.files[n].bytesCopiedこれまでにコピーされたバイト数。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.initialSyncStatus.files[n].extensionNumberこのファイルが拡張機能の一部である場合、ファイルが属する拡張機能の番号。
このフィールドは、ファイル コピー ベースの最初の同期を使用する場合にのみ表示されます。
replSetGetStatus.membersmembersフィールドは、レプリカセット内のすべてのノードのドキュメントを含む配列を保持します。replSetGetStatus.members[n].ipThe resolved IP address of the member. If the
mongodis unable to resolve thereplSetGetStatus.members[n].nameto an IP address, the return value is a BSON null. Otherwise, the returned value is a string representation of the resolved IP address.
replSetGetStatus.members[n].selfノードが現在の
mongodインスタンスであるかどうかを示すブール値。selfフィールドは、現在のmongodインスタンスのドキュメントにのみ含まれるため、その値は常にtrueです。
replSetGetStatus.members[n].stateノードのレプリカ状態を表す
0から10までの整数。
replSetGetStatus.members[n].stateStrA string that describes
state.
replSetGetStatus.members[n].uptimeFor the member on which the
replSetGetStatuscommand is run,uptimeis the the number of seconds the member has been online.For the other members,
uptimeis the number of seconds the member has been in continuous communication with the member on which thereplSetGetStatuscommand was run.
replSetGetStatus.members[n].optimeこのノードが適用した最後の操作に関する oplog からの情報。
optimeは、次の内容を含むドキュメントを返します。t, thetermin which the last applied operation was originally generated on the primary.
replSetGetStatus.members[n].optimeDurableこのノードがジャーナルに適用した最後の操作に関する oplog からの情報。
optimeDurableは、次の内容を含むドキュメントを返します。
replSetGetStatus.members[n].optimeDateAn ISODate formatted date string that contains the last entry from the oplog that this member applied. If this differs significantly from
lastHeartbeatthis member is either experiencing "replication lag" or there have not been any new operations after the last update. Comparemembers.optimeDatebetween all of the members of the set.
replSetGetStatus.members[n].lastAppliedWallTimeレプリカセットのこのノードによって適用された最後の操作がプライマリノードに適用された時点を反映するISODate形式のstring。
replSetGetStatus.members[n].lastDurableWallTimeこのノードのジャーナルに書込まれた最後の操作がプライマリノードに最初に適用された時点を反映するISODate形式のstring。
replSetGetStatus.members[n].electionTime現在のプライマリについて、oplog からの選挙タイムスタンプに関する情報。選挙の詳細については、「レプリカセットの高可用性」を参照してください。
replSetGetStatus.members[n].electionDate現在のプライマリについて、選挙日を含む ISODate 形式の文字列。選挙の詳細については、「レプリカセットの高可用性」を参照してください。
replSetGetStatus.members[n].lastHeartbeatAn ISODate formatted date and time that contains the last time the server that processed the replSetGetStatus command received a response from a heartbeat that it sent to this member (
members[n]). Compare this value to the values of thedateandlastHeartbeatRecvfields to track latency between these replica set members.This value is only available for replica set members other than the server specified by
replSetGetStatus.members[n].self.
replSetGetStatus.members[n].lastHeartbeatRecvAn ISODate formatted date and time that contains the last time the server that processed the replSetGetStatus command received a heartbeat request from this member (
members[n]). Compare this value to the values of thedateandlastHeartbeatfields to track latency between these replica set members.This value is only available for replica set members other than the server specified by
replSetGetStatus.members[n].self.
replSetGetStatus.members[n].lastHeartbeatMessageWhen the last heartbeat included an extra message, the
lastHeartbeatMessagecontains a string representation of that message.
replSetGetStatus.members[n].pingMspingMsは、ラウンドトリップ パケットがリモート ノードとローカル インスタンスの間を移動するのにかかるミリ秒(ms)数を表します。この値は、
rs.status()データを返すノードには表示されません。
replSetGetStatus.members[n].syncSourceHostThe
syncSourceHostfield holds the hostname of the member from which this instance syncs.If the
replSetGetStatus.members[n]is a primary,syncSourceHostis an empty string and thesyncSourceId-1.
replSetGetStatus.members[n].syncSourceIdThe
syncSourceIdfield holds thereplSetGetStatus.members[n]._idvalue of thesyncSourceHost.If the
replSetGetStatus.members[n]is a primary,syncSourceHostis an empty string and thesyncSourceId-1.
replSetGetStatus.members[n].configVersionconfigVersion値はreplica set configuration versionです。
replSetGetStatus.tooStaleA boolean which indicates that a replica set member has fallen too far behind the primary's oplog and is stuck in the
RECOVERINGstate. This field is only included in thereplSetGetStatusoutput if its value istrue.
ok ステータス フィールド、operationTime フィールド、および $clusterTime フィールドの詳細については、「応答」も参照してください。
replSetGetStatus.optimeレプリカセットからノードを削除した後に存在します。 削除されたノードによって適用された最後の oplog エントリのoptimeを提供します。