AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

replSetGetConfig(데이터베이스 명령)

replSetGetConfig

복제본 세트 의 현재 구성 을 설명하는 문서를 반환합니다.

In mongosh, this command can also be run through the rs.conf() helper method.

Helper methods are convenient for mongosh users, 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 클러스터에서 지원되지 않습니다. 자세한 내용은 지원되지 않는 명령을 참조하세요.

To run, replSetGetConfig must be issued against the admin database. The command has the following syntax:

db.adminCommand(
{
replSetGetConfig: 1,
commitmentStatus: <boolean>,
comment: <any>
}
)
필드
유형
설명

replSetGetConfig

any

모든 값

부울

Optional. Specify true to include a commitmentStatus field in the output. The commitmentStatus output field indicates whether the replica set's previous reconfig has been committed, so that the replica set is ready to be reconfigured again. For details, see commitmentStatus Output Field.

프라이머리에서 명령을 실행할 때만 commitmentStatus: true 옵션을 지정할 수 있습니다. 세컨더리에서 commitmentStatus: true 으로 실행하면 명령 오류가 발생합니다.

comment

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)
}
필드
설명

config

복제본 세트 구성입니다. 각 구성 설정에 대한 설명은 자체 관리형 복제본 세트 구성을 참조하세요.

가장 최근의 복제본 세트 구성이 커밋되었는지 여부를 나타내는 부울입니다. 즉

  • 프라이머리에 대한 가장 최근의 복제본 세트 구성이 대다수의 멤버에게 전파되었습니다.

  • 이전 구성을 사용한 복제본 세트에 대한 마지막 쓰기 작업은 새 구성에서 majority-committed 이었습니다.

If true, then the configuration has been committed, and the replica set can be reconfigured. To reconfigure the replica set, see replSetReconfig command or the mongosh method rs.reconfig().

false 인 경우 구성이 커밋되지 않았으며 복제본 세트를 재구성할 수 없습니다.

ok

명령이 성공했는지(1) 또는 실패했는지(0)를 나타내는 숫자입니다.

operationTime
$clusterTime

복제본 세트에 대한 모든 명령과 함께 반환됩니다. 자세한 내용은 db.adminCommand Response 에서 확인 가능합니다.

이 페이지 평가하기