定義
clearJumboFlagClears the jumbo flag for a chunk. To use the command, issue the
clearJumboFlagcommand on amongosinstance.
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
- MongoDB Atlas はクラウドでの MongoDB 配置のための完全管理サービスです
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
th コマンドの構文は次のとおりです。
db.adminCommand( { clearJumboFlag: "<database>.<collection>", bounds: <array> } )
-あるいは-
// Cannot use for collections with hashed shard keys db.adminCommand( { clearJumboFlag: "<database>.<collection>", find: <query> } )
コマンドフィールド
The clearJumboFlag command takes the following fields as arguments:
フィールド | タイプ | 説明 |
|---|---|---|
string | ||
配列 | 特定のチャンクの正確な境界。 配列は、移動するチャンクのシャードキーの下限と上限のシャードキー値を指定する 2 つのドキュメントで構成されている必要があります。
| |
ドキュメント | ジャンボ チャンクに含まれる特定の シャードキー とその値。
|
アクセス制御
authorizationclearJumboFlagで実行されているシステムでは、ユーザーは{ db: "", collection: "" } リソース に対して 特権アクションを持っている必要があります。
組み込みロールclusterManagerは適切な特権を提供します。
例
チャンクのジャンボフラグのクリア(範囲ベースのシャードキー)
sh.status()には、 test.jumboコレクション用に次のsh.status.databases.<collection>.chunk-detailsが含まれています。
... // Content omitted for brevity test.jumbo shard key: { "x" : 1 } unique: false balancing: true chunks: shardA 2 shardB 2 { "x" : { "$minKey" : 1 } } -->> { "x" : 1 } on : shardB Timestamp(3, 0) { "x" : 1 } -->> { "x" : 2 } on : shardA Timestamp(6, 1) jumbo { "x" : 2 } -->> { "x" : 3 } on : shardA Timestamp(5, 1) jumbo { "x" : 3 } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(6, 0)
The following clearJumboFlag command specifies the bounds of the { "x" : 1 } -->> { "x" : 2 } chunk:
db.adminCommand( { clearJumboFlag: "test.jumbo", bounds: [{ "x" : 1 }, { "x" : 2 }] } )
成功すると、コマンドは出力に"ok": 1を返します。
{ "ok" : 1, "operationTime" : Timestamp(1580190080, 5), "$clusterTime" : { "clusterTime" : Timestamp(1580190080, 5), "signature" : { "hash" : BinData(0,"0cYT49s72MHUYV1F2WpoEwlyeVs="), "keyId" : Long("6786859092951433239") } } }
The following clearJumboFlag command specifies the find field to find the chunk that contains the shard key { "x" : 2 } :
db.adminCommand( { clearJumboFlag: "test.jumbo", find: { "x" : 2 } } )
成功すると、コマンドは出力に"ok": 1を返します。
{ "ok" : 1, "operationTime" : Timestamp(1580191819, 5), "$clusterTime" : { "clusterTime" : Timestamp(1580191819, 5), "signature" : { "hash" : BinData(0,"N6x6drN7HUq5MR5ezUJns1rfeqY="), "keyId" : Long("6786859092951433239") } } }
操作を確認するには、 sh.status()を再度実行します。 jumboフラグは出力に表示されなくなります。
... // Content omitted for brevity test.jumbo shard key: { "x" : 1 } unique: false balancing: true chunks: shardA 2 shardB 2 { "x" : { "$minKey" : 1 } } -->> { "x" : 1 } on : shardB Timestamp(3, 0) { "x" : 1 } -->> { "x" : 2 } on : shardA Timestamp(7, 0) { "x" : 2 } -->> { "x" : 3 } on : shardA Timestamp(8, 0) { "x" : 3 } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(6, 0)
チャンクのジャンボフラグのクリア(ハッシュされたシャードキー)
sh.status()には、 test.jumboHashedコレクション用に次のsh.status.databases.<collection>.chunk-detailsが含まれています。 コレクションでは ハッシュされたシャードキー が使用されます。
... // Content omitted for brevity test.jumboHashed shard key: { "x" : "hashed" } unique: false balancing: true chunks: shardA 2 shardB 2 { "x" : { "$minKey" : 1 } } -->> { "x" : Long(0) } on : shardA Timestamp(1, 0) { "x" : Long(0) } -->> { "x" : Long("848411777775835583") } on : shardA Timestamp(4, 0) { "x" : Long("848411777775835583") } -->> { "x" : Long("5902408780260971510") } on : shardB Timestamp(4, 1) jumbo { "x" : Long("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)
To clear the jumbo flag for a chunk if the collection uses a hashed shard key, use clearJumboFlag with the bounds field:
db.adminCommand( { clearJumboFlag: "test.jumboHashed", bounds: [{ "x" : Long("848411777775835583") }, { "x" : Long("5902408780260971510") }] } )
成功すると、コマンドは出力に"ok": 1を返します。
{ "ok" : 1, "operationTime" : Timestamp(1580194290, 5), "$clusterTime" : { "clusterTime" : Timestamp(1580194290, 5), "signature" : { "hash" : BinData(0,"nWCqOYVrab7NEGHWoo2NYENqHR4="), "keyId" : Long("6786875525496307742") } } }
操作を確認するには、 sh.status()を再度実行します。 jumboフラグは出力に表示されなくなります。
... // Content omitted for brevity test.jumboHashed shard key: { "x" : "hashed" } unique: false balancing: true chunks: shardA 2 shardB 2 { "x" : { "$minKey" : 1 } } -->> { "x" : Long(0) } on : shardA Timestamp(1, 0) { "x" : Long(0) } -->> { "x" : Long("848411777775835583") } on : shardA Timestamp(4, 0) { "x" : Long("848411777775835583") } -->> { "x" : Long("5902408780260971510") } on : shardB Timestamp(5, 0) { "x" : Long("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)
Tip