Overview
すべての mongod インスタンスには独自の local データベースがあり、レプリケーションプロセスで使用されるデータやその他のインスタンス固有のデータが格納されます。local データベース内のコレクションは複製されません。
すべての mongod インスタンスのコレクション
local.startup_logOn startup, each
mongodinstance inserts a document intostartup_logwith diagnostic information about themongodinstance itself and host information.startup_logis a capped collection. This information is primarily useful for diagnostic purposes.For example, the following is a prototype of a document from the
startup_logcollection:{ "_id" : "<string>", "hostname" : "<string>", "startTime" : ISODate("<date>"), "startTimeLocal" : "<string>", "cmdLine" : { "dbpath" : "<path>", "<option>" : <value> }, "pid" : <number>, "buildinfo" : { "version" : "<string>", "gitVersion" : "<string>", "sysInfo" : "<string>", "loaderFlags" : "<string>", "compilerFlags" : "<string>", "allocator" : "<string>", "versionArray" : [ <num>, <num>, <...> ], "javascriptEngine" : "<string>", "bits" : <number>, "debug" : <boolean>, "maxBsonObjectSize" : <number> } } Documents in the
startup_logcollection contain the following fields:local.startup_log.startTimeサーバーの起動時刻を反映する UTC のISODate 値。
local.startup_log.startTimeLocalA string that reports the
startTimein the system's local time zone.
local.startup_log.cmdLinemongodランタイム オプションとその値を報告する埋め込みドキュメント。
レプリカセット ノードのコレクション
local.system.replsetlocal.system.replsetholds the replica set's configuration object as its single document. To view the object's configuration information, issuers.conf()frommongosh. You can also query this collection directly.
local.oplog.rslocal.oplog.rsis the capped collection that holds the oplog. You set its size at creation using theoplogSizeMBsetting. To resize the oplog after replica set initiation, use the Change the Oplog Size of Self-Managed Replica Set Members procedure. For additional information, see the Oplog Size section.oplog は、
majority commit pointが削除されるのを回避するために、設定されたサイズ制限を超えて大きくなることがあります。MongoDB 5.0 以降では、 oplogへの手動書き込み操作が制限されています。詳細については、 「Oplog コレクションの動作」 を参照してください。
制限事項
- マルチドキュメントトランザクション
local - マルチドキュメントトランザクション内では、
localデータベース内のコレクションに対して読み取り/書き込み操作を実行することはできません。 - 再試行可能な書き込み再試行可能な書込み
local 再試行可能な書き込みが有効になっていると、
localデータベース内のコレクションへの書込み操作は実行できません。重要
公式のMongoDBドライバーでは、デフォルトで 再試行可能な書き込みが有効になっています。
localデータベースに書き込むアプリケーションでは、再試行可能な書き込みが明示的に無効になっていない限り、書き込みエラーが発生します。再試行可能な書き込みを無効にするには、MongoDB の接続文字列に
retryWrites=falseを指定します。