문서 메뉴

문서 홈애플리케이션 개발MongoDB 매뉴얼

clearJumboFlag

이 페이지의 내용

  • 정의
  • 구문
  • 액세스 제어
  • 예제
clearJumboFlag

4.2.3 및 4.0.15부터 사용 가능

청크의 점보 플래그를 지웁니다. 명령을 사용하려면 clearJumboFlag 인스턴스에서 mongos 명령을 실행합니다.

명령에는 다음과 같은 구문이 있습니다.

db.adminCommand(
{
clearJumboFlag: "<database>.<collection>",
bounds: <array>
}
)

-또는-

// Cannot use for collections with hashed shard keys
db.adminCommand(
{
clearJumboFlag: "<database>.<collection>",
find: <query>
}
)

clearJumboFlag 명령은 다음 필드를 인수로 사용합니다.

필드
유형
설명
clearJumboFlag
문자열

점보 청크가 있는 샤드 컬렉션 의 네임스페이스 입니다.

데이터베이스 이름을 포함하여 컬렉션의 전체 네임스페이스를 지정합니다(예: "<database>.<collection>")

배열

특정 청크의 정확한 경계입니다. 배열은 이동할 청크의 하위 및 상위 샤드 키 값을 지정하는 두 개의 문서로 구성되어야 합니다.

[ { <shardKey> : <minValue> },{ <shardKey> : <maxValue> } ]

참고

  • 경계 필드 또는 찾기 필드 중 하나를 지정하되 둘 다 지정하지는 않습니다.

  • 컬렉션이 해시 샤드 키 를 사용하는 경우 경계 필드를 사용합니다.

문서

점보 청크에 포함된 특정 샤드 키와 해당 값.

{ <shardKey> : <value> }

참고

(으)로 authorization 실행되는 시스템에서 사용자는 clearJumboFlag리소스 에 대한 권한 작업을 가지고 있어야 합니다.{ db: "", collection: "" }

기본 제공 역할 clusterManager 은(는) 적절한 권한을 제공합니다.

sh.status() 에는 test.jumbo collection에 대한 다음 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)

다음 clearJumboFlag 명령은 { "x" : 1 } -->> { "x" : 2 } 청크의 경계 를 지정합니다.

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" : NumberLong("6786859092951433239")
}
}
}

다음 clearJumboFlag 명령은 찾기 필드를 지정하여 샤드 키 { "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" : NumberLong("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 collection에 대한 다음 sh.status.databases.<collection>.chunk-details 가 포함되어 있습니다. collection은 해시 샤드 키를 사용합니다.

... // Content omitted for brevity
test.jumboHashed
shard key: { "x" : "hashed" }
unique: false
balancing: true
chunks:
shardA 2
shardB 2
{ "x" : { "$minKey" : 1 } } -->> { "x" : NumberLong(0) } on : shardA Timestamp(1, 0)
{ "x" : NumberLong(0) } -->> { "x" : NumberLong("848411777775835583") } on : shardA Timestamp(4, 0)
{ "x" : NumberLong("848411777775835583") } -->> { "x" : NumberLong("5902408780260971510") } on : shardB Timestamp(4, 1) jumbo
{ "x" : NumberLong("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)

컬렉션이 해시 샤드 jumbo 키 를 사용하는 경우 청크에 대한 플래그를 지우려면 경계 필드와 함께 를 사용합니다.clearJumboFlag

db.adminCommand( {
clearJumboFlag: "test.jumboHashed",
bounds: [{ "x" : NumberLong("848411777775835583") }, { "x" : NumberLong("5902408780260971510") }]
} )

성공하면 명령은 출력에 "ok": 1 을(를) 반환합니다.

{
"ok" : 1,
"operationTime" : Timestamp(1580194290, 5),
"$clusterTime" : {
"clusterTime" : Timestamp(1580194290, 5),
"signature" : {
"hash" : BinData(0,"nWCqOYVrab7NEGHWoo2NYENqHR4="),
"keyId" : NumberLong("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" : NumberLong(0) } on : shardA Timestamp(1, 0)
{ "x" : NumberLong(0) } -->> { "x" : NumberLong("848411777775835583") } on : shardA Timestamp(4, 0)
{ "x" : NumberLong("848411777775835583") } -->> { "x" : NumberLong("5902408780260971510") } on : shardB Timestamp(5, 0)
{ "x" : NumberLong("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)

다음도 참조하세요.

← checkShardingIndex

이 페이지의 내용