정의
replSetGetConfig복제본 세트 의 현재 구성 을 설명하는 문서를 반환합니다.
팁
In
mongosh, this command can also be run through thers.conf()helper method.Helper methods are convenient for
mongoshusers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
중요
이 명령은 M0 및 Flex 클러스터에서 지원되지 않습니다. 자세한 내용은 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
To run, replSetGetConfig must be issued against the admin database. The command has the following syntax:
db.adminCommand( { replSetGetConfig: 1, commitmentStatus: <boolean>, comment: <any> } )
명령 필드
필드 | 유형 | 설명 |
|---|---|---|
| any | 모든 값 |
부울 | Optional. Specify 프라이머리에서 명령을 실행할 때만 | |
| any | 선택 사항. 이 명령에 첨부할 사용자 제공 코멘트입니다. 설정되면 이 설명은 다음 위치에서 이 명령의 레코드와 함께 표시됩니다.
댓글은 유효한 모든 BSON types (문자열, 정수, 객체, 배열 등)이 될 수 있습니다. |
mongosh provides the rs.conf() method that wraps the replSetGetConfig command:
rs.conf();
출력 예시
The following is an example output of the replSetGetConfig command run with commitmentStatus: true on the primary:
{ "config" : { "_id" : "myRepl", "version" : 180294, "term" : 1, "protocolVersion" : Long(1), "writeConcernMajorityJournalDefault" : true, "members" : [ { "_id" : 0, "host" : "m1.example.net:27017", "arbiterOnly" : false, "buildIndexes" : true, "hidden" : false, "priority" : 1, "tags" : { }, "secondaryDelaySecs" : Long(0), "votes" : 1 }, { "_id" : 1, "host" : "m2.example.net:27017", "arbiterOnly" : false, "buildIndexes" : true, "hidden" : false, "priority" : 1, "tags" : { }, "secondaryDelaySecs" : Long(0), "votes" : 1 }, { "_id" : 2, "host" : "m3.example.net:27017", "arbiterOnly" : false, "buildIndexes" : true, "hidden" : false, "priority" : 1, "tags" : { }, "secondaryDelaySecs" : Long(0), "votes" : 1 } ], "settings" : { "chainingAllowed" : true, "heartbeatIntervalMillis" : 2000, "heartbeatTimeoutSecs" : 10, "electionTimeoutMillis" : 10000, "catchUpTimeoutMillis" : -1, "catchUpTakeoverDelayMillis" : 30000, "getLastErrorModes" : { }, "getLastErrorDefaults" : { "w" : 1, "wtimeout" : 0 }, "replicaSetId" : ObjectId("5eaa1e9ac4d650aa7817623d") } }, "commitmentStatus" : true, "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1588212091, 1), "signature" : { "hash" : BinData(0,"veOHa2mOeRTzuR0LKqnzGxWV77k="), "keyId" : Long("6821298283919441923") } }, "operationTime" : Timestamp(1588212091, 1) }
필드 | 설명 |
|---|---|
| 복제본 세트 구성입니다. 각 구성 설정에 대한 설명은 자체 관리형 복제본 세트 구성을 참조하세요. |
가장 최근의 복제본 세트 구성이 커밋되었는지 여부를 나타내는 부울입니다. 즉
If
| |
| 명령이 성공했는지( |
| 복제본 세트에 대한 모든 명령과 함께 반환됩니다. 자세한 내용은 db.adminCommand Response 에서 확인 가능합니다. |