Docs Menu
Docs Home
/
MongoDB 매뉴얼
/ / /

컬렉션 이동 중지

이 페이지의 내용

  • 이 작업에 대하여
  • 액세스 제어
  • 단계
  • 자세히 알아보기

You can stop moving an unsharded collection by using the abortMoveCollection command.

진행 중인 moveCollection 작업을 중지하려면 admin 데이터베이스 에서 abortMoveCollection 명령을 실행 합니다.

배포서버 에 액세스 제어 가 활성화되어 있는 경우 enableSharding 역할 통해 abortMoveCollection 명령을 실행 수 있습니다.

1

컬렉션 이동을 중지하려면 abortMoveCollection 명령을 실행 합니다. 다음 예시 에서는 shard01 에서 shard02 로 진행 중인 app.inventory 컬렉션 의 이동을 중지합니다.

db.adminCommand( {
abortMoveCollection: "app.inventory"
} )

After you run the abortMoveCollection command, the command output returns ok: 1 and resembles the following:

{
ok: 1,
'$clusterTime': {
clusterTime: Timestamp( { t: 1726524884, i: 28 } ),
signature: {
hash: Binary.createFromBase64('AAAAAAAAAAAAAAAAAAAAAAAAAAA=', 0),
keyId: Long('0')
}
},
operationTime: Timestamp({ t: 1726524884, i: 28 })
}
2

컬렉션 이 새 샤드 로 이동되지 않았는지 확인하려면 $collStats 파이프라인 단계를 사용합니다.

다음 예시 에서는 app.inventory 컬렉션 이 동일한 샤드 에 남아 있는지 확인하는 방법을 보여 줍니다.

db.inventory.aggregate( [
{ $collStats: {} },
{ $project: { "shard": 1 } }
] )

This pipeline stage has output similar to the following:

[ { shard: 'shard01' } ]

돌아가기

이동식 컬렉션이 있는 멀티테넌트 아키텍처