정의
db.fsyncUnlock()서버의 잠금 횟수를 줄여 쓰기 작업을 다시 활성화합니다.
MongoDB 7.0.2 (6.0.11및 5.0.22부터도 사용 가능)부터
db.fsyncLock()및db.fsyncUnlock()메서드는mongos에서 실행되어 샤딩된 클러스터를 잠그거나 잠금 해제할 수 있습니다.중요
Mongo쉬 방법
This page documents a
mongoshmethod. This is not the documentation for database commands or language-specific drivers, such as Node.js.데이터베이스 명령에 대해서는
fsyncUnlock명령을 참조하십시오.MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.
Servers maintain an fsync lock count. The
fsyncLock()method increments the lock count while thefsyncUnlock()method decrements it. To unlock writes on a server or cluster, call thefsyncUnlock()method until the lock count reaches zero.db.fsyncUnlock()is an administrative operation. Use this method to unlock a server or cluster after a backup operationdb.fsyncUnlock()의 구문은 다음과 같습니다.db.fsyncUnlock() 이 작업은 다음 필드가 있는 문서를 반환합니다.
info작업 상태에 대한 정보입니다.
lockCount작업 후 인스턴스에 남아 있는 잠금 수입니다.
ok상태 코드입니다.
The
db.fsyncUnlock()method wraps thefsyncUnlockcommand.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
중요
이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
WiredTiger와의 호환성
db.fsyncLock()은(는) cp, scp 또는 tar와(과) 같은 낮은 수준의 백업 유틸리티를 사용하여 데이터 파일을 안전하게 복사할 수 있도록 보장합니다. 복사된 파일을 사용하여 시작된 mongod에는 잠긴 mongod의 사용자 작성 데이터와 구별할 수 없는 사용자 작성 데이터가 포함되어 있습니다.
잠긴 mongod 의 데이터 파일은 저널링 동기화 또는 WiredTiger 스냅샷과 같은 작업으로 인해 변경될 수 있습니다. 논리적 데이터에는 영향을 주지 않지만(예: 클라이언트가 액세스하는 데이터), 일부 백업 유틸리티는 이러한 변경 사항을 감지하여 경고를 표시하거나 오류로 인해 실패할 수 있습니다. MongoDB- 권장 백업 유틸리티 및 절차에 대한 자세한 내용은 자체 관리 배포서버를 위한 백업 방법을 참조하세요.
예시
Consider a situation where db.fsyncLock() has been issued two times. The following db.fsyncUnlock() operation reduces the locks taken by db.fsyncLock() by 1:
db.fsyncUnlock()
연산은 다음 문서를 반환합니다.
{ "info" : "fsyncUnlock completed", "lockCount" : Long(1), "ok" : 1 }
lockCount 가 0보다 크면 mongod 인스턴스가 쓰기에 대해 잠깁니다. 쓰기에 대한 인스턴스의 잠금을 해제하려면 db.fsyncLock() 를 다시 실행합니다.
db.fsyncUnlock()
연산은 다음 문서를 반환합니다.
{ "info" : "fsyncUnlock completed", "lockCount" : Long(0), "ok" : 1 }
mongod 인스턴스는 쓰기에 대해 잠금 해제됩니다.