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

replSetGetStatus(データベースコマンド)

replSetGetStatus

replSetGetStatus コマンドは、コマンドを処理したサーバーの観点からレプリカセットのステータスを返します。replSetGetStatus は、管理データベースで実行する必要があります。

The mongod instance must be a replica set member for replSetGetStatus to return successfully.

このコマンドによって提供されるデータは、レプリカセットの他のノードによってサーバーに送信されるハートビートに含まれるデータから派生します。ハートビートの頻度により、これらのデータは数秒古くなる可能性があります。

Tip

In mongosh, this command can also be run through the rs.status() helper method.

Helper methods are convenient for mongosh users, 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: 1 to include the replSetGetStatus.initialSyncStatus in 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.initialSyncStatus document 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.set

set 値は、replSetName 設定で構成されたレプリカセットの名前です。これは rs.conf()_id と同じ値です。

replSetGetStatus.date

An 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].lastHeartbeat to find the operational latency between this server and the other members of the replica set.

replSetGetStatus.myState

現在のノードのレプリカ状態を表す 0 から 10 までの整数。

replSetGetStatus.term

The election count for the replica set, as known to this replica set member. The term is used by the distributed consensus algorithm to ensure correctness.

replSetGetStatus.syncSourceHost

The syncSourceHost field holds the hostname of the member from which this instance syncs.

If this instance is a primary, syncSourceHost is an empty string and the syncSourceId -1.

replSetGetStatus.syncSourceId

The syncSourceId field holds the replSetGetStatus.members[n]._id of the member from which this instance synchronizes.

If this instance is a primary, syncSourceHost is an empty string and the syncSourceId -1.

replSetGetStatus.heartbeatIntervalMillis

ハートビートの頻度(ミリ秒単位)。

replSetGetStatus.majorityVoteCount

選挙で新しいプライマリを選出するために必要な過半数の票の数。

replSetGetStatus.writeMajorityCount

書込み保証 (write concern) "majority" を実行するに必要なデータを持つ投票ノードの数。書き込み (write) は、データを持つノードにのみ適用できます。

For the calculation of replSetGetStatus.writeMajorityCount, see Calculating Majority for Write Concern.

replSetGetStatus.votingMembersCount

votes: 1 で構成されたノードの数(アービタを含む)。

replSetGetStatus.writableVotingMembersCount

votes: 1 で構成されたデータを持つノードの数(これはアービタを含みません)。

replSetGetStatus.optimes

optimesフィールドは、レプリケーションの進行状況を検査するために使用されるoptimeを含むドキュメントを保持します。 optimesフィールドには、さまざまな optime に対応する ISODate 形式の日付文字列が含まれています。

各 optime 値は、次の内容を含むドキュメントです。

replSetGetStatus.optimes.lastCommittedOpTime

レプリカセット ノードの過半数に書き込まれた最新の操作に関する、このノードから見た情報。

replSetGetStatus.optimes.lastCommittedWallTime

The ISODate-formatted date string corresponding to lastCommittedOpTime.

replSetGetStatus.optimes.readConcernMajorityOpTime

読み取り保証 (read concern)lastCommittedOpTime"majority" クエリを満たすことができる直近の操作に関する、このノードの観点に基づく情報。これは、lastCommittedOpTime "majority"クエリを満たすことができる直近のreadConcernMajorityOpTime です。 は より小さいか等しいです。

replSetGetStatus.optimes.appliedOpTime

レプリカセットのこのノードに適用された最新の操作に関する、このノードの観点から見た情報。

replSetGetStatus.optimes.lastAppliedWallTime

The ISODate-formatted date string corresponding to appliedOpTime.

replSetGetStatus.optimes.durableOpTime

レプリカセットのこのノードのジャーナルに書込まれた最新の操作に関する、このノードの観点から見た情報。

replSetGetStatus.optimes.lastDurableWallTime

The ISODate-formatted date string corresponding to durableOpTime.

replSetGetStatus.lastStableRecoveryTimestamp

内部でのみ使用します。

replSetGetStatus.electionCandidateMetrics

Metrics related to the election of the current primary. electionCandidateMetrics is 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.lastElectionReason

ノードが選挙を呼び出した理由。

replSetGetStatus.electionCandidateMetrics.lastElectionDate

ノードが選挙を呼び出した日時。

replSetGetStatus.electionCandidateMetrics.electionTerm

term新しい選挙を呼び出した時点でのノードの選挙数( )。

replSetGetStatus.electionCandidateMetrics.lastCommittedOpTimeAtElection

The most recent majority-committed optime, as seen by this member, at the time it called the new election.

replSetGetStatus.electionCandidateMetrics.lastSeenOpTimeAtElection

The member's most recent applied optime at the time it called the new election.

replSetGetStatus.electionCandidateMetrics.numVotesNeeded

選挙に当選するために必要な票数。

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 term oplog エントリが過半数コミットされた日時)。

replSetGetStatus.electionParticipantMetrics

ノードが参加した最新の選挙に関連するメトリクス。

replSetGetStatus.electionParticipantMetrics.votedForCandidate

ノードが選挙を呼び出した候補者に投票したかどうかを示すブール値。

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.newTermStartDate instead.

replSetGetStatus.electionParticipantMetrics.newTermAppliedDate

このセカンダリが new term エントリを適用した日時。

このフィールドは、セカンダリ ノードのみが使用できます。

replSetGetStatus.initialSyncStatus

このノードの最初の同期の進行状況とステータスに関する情報を提供するドキュメント。

重要

可用性

replSetGetStatus.initialSyncStatus metrics are only available when run on a member during its initial sync, in the STARTUP2 state.

replSetGetStatus.initialSyncStatus.failedInitialSyncAttempts

このノードで最初の同期が失敗し、再開する必要があった回数。

replSetGetStatus.initialSyncStatus.maxFailedInitialSyncAttempts

ノードがシャットダウンする前に、このノードで最初の同期を再開できる最大回数。

replSetGetStatus.initialSyncStatus.initialSyncStart

このノードの最初の同期の開始タイムスタンプ。

replSetGetStatus.initialSyncStatus.initialSyncEnd

このノードの最初の同期の終了タイムスタンプ。

replSetGetStatus.initialSyncStatus.initialSyncElapsedMillis

The number of milliseconds between initialSyncStart and initialSyncEnd.

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.totalTimeUnreachableMillis

現在の最初の同期中にノードが利用不可になっていた時間の合計(ミリ秒単位)。

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.members

members フィールドは、レプリカセット内のすべてのノードのドキュメントを含む配列を保持します。

replSetGetStatus.members[n]._id

ノードの弁別子。

replSetGetStatus.members[n].name

ノードの名前。

replSetGetStatus.members[n].ip

The resolved IP address of the member. If the mongod is unable to resolve the replSetGetStatus.members[n].name to 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].health

ノードがアップ(1)かダウン(0)かを示す数値。

replSetGetStatus.members[n].state

ノードのレプリカ状態を表す 0 から 10 までの整数。

replSetGetStatus.members[n].stateStr

A string that describes state.

replSetGetStatus.members[n].uptime

For the member on which the replSetGetStatus command is run, uptime is the the number of seconds the member has been online.

For the other members, uptime is the number of seconds the member has been in continuous communication with the member on which the replSetGetStatus command was run.

replSetGetStatus.members[n].optime

このノードが適用した最後の操作に関する oplog からの情報。

optime は、次の内容を含むドキュメントを返します。

  • tsoplog からレプリカセットのこのノードに適用された最後の操作のタイムスタンプ

  • t, the term in which the last applied operation was originally generated on the primary.

replSetGetStatus.members[n].optimeDurable

このノードがジャーナルに適用した最後の操作に関する oplog からの情報。

optimeDurable は、次の内容を含むドキュメントを返します。

replSetGetStatus.members[n].optimeDate

An ISODate formatted date string that contains the last entry from the oplog that this member applied. If this differs significantly from lastHeartbeat this member is either experiencing "replication lag" or there have not been any new operations after the last update. Compare members.optimeDate between all of the members of the set.

replSetGetStatus.members[n].optimeDurableDate

このノードがジャーナル適用した oplog からの最後のエントリを含む ISODate 形式の文字列。

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].lastHeartbeat

An 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 the date and lastHeartbeatRecv fields 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].lastHeartbeatRecv

An 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 the date and lastHeartbeat fields 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].lastHeartbeatMessage

When the last heartbeat included an extra message, the lastHeartbeatMessage contains a string representation of that message.

replSetGetStatus.members[n].pingMs

pingMs は、ラウンドトリップ パケットがリモート ノードとローカル インスタンスの間を移動するのにかかるミリ秒(ms)数を表します。

この値は、rs.status() データを返すノードには表示されません。

replSetGetStatus.members[n].syncSourceHost

The syncSourceHost field holds the hostname of the member from which this instance syncs.

If the replSetGetStatus.members[n] is a primary, syncSourceHost is an empty string and the syncSourceId -1.

replSetGetStatus.members[n].syncSourceId

The syncSourceId field holds the replSetGetStatus.members[n]._id value of the syncSourceHost.

If the replSetGetStatus.members[n] is a primary, syncSourceHost is an empty string and the syncSourceId -1.

replSetGetStatus.members[n].configVersion

configVersion 値は replica set configuration version です。

replSetGetStatus.tooStale

A boolean which indicates that a replica set member has fallen too far behind the primary's oplog and is stuck in the RECOVERING state. This field is only included in the replSetGetStatus output if its value is true.

ok ステータス フィールド、operationTime フィールド、および $clusterTime フィールドの詳細については、「応答」も参照してください。

replSetGetStatus.optime

レプリカセットからノードを削除した後に存在します。 削除されたノードによって適用された最後の oplog エントリのoptimeを提供します。

replSetGetStatus.optimeDate

レプリカセットからノードを削除した後に存在します。 string削除されたノードによって適用された最後のoptime oplogエントリの の ISODate 形式 を提供します。

このページを評価