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

replSetStepDown(데이터베이스 명령)

replSetStepDown

복제본 세트 프라이머리 세컨더리 되도록 지시합니다. 프라이머리 가 강등된 후에는 자격을 갖춘 세컨더리가 프라이머리 투표 실시합니다.

이 명령은 프라이머리를 즉시 강등시키지 않습니다. If no electable secondaries are up to date with the primary, the primary waits up to secondaryCatchUpPeriodSecs (by default 10 seconds) for a secondary to catch up. 선택 가능한 세컨더리를 사용할 수 있게 되면 명령이 프라이머리를 강등합니다.

일단 중단되고 나면 원래의 프라이머리가 세컨더리로 바뀌며, replSetStepDown: <seconds>(으)로 지정된 기간 중 남은 시간 동안 다시 프라이머리가 될 수 있는 자격을 잃습니다.

명령 실행에 대한 자세한 설명은 동작 을 참조하세요.

참고

이 명령은 프라이머리에 대해서만 유효하며 프라이머리가 아닌 멤버에서 실행하면 오류가 발생합니다.

In mongosh, this command can also be run through the rs.stepDown() 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.

The replSetStepDown can only run on the admin database.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

중요

이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.

명령은 다음과 같은 구문을 가집니다:

db.adminCommand(
{
replSetStepDown: <seconds>,
secondaryCatchUpPeriodSecs: <seconds>,
force: <true|false>
}
)

이 명령은 다음 필드를 사용합니다.

필드
유형
설명

replSetStepDown

숫자

프라이머리를 강등시키는 데 걸리는 시간(초)으로, 이 시간 동안에는 강등된 멤버가 프라이머리가 될 수 없습니다. 숫자가 아닌 값을 지정하면 이 명령이 60초를 사용합니다.

강등 기간은 mongod이(가) 명령을 받은 시점부터 시작됩니다. 강등 기간은 secondaryCatchUpPeriodSecs보다 커야 합니다.

secondaryCatchUpPeriodSecs

숫자

선택 사항. mongod 가 선택 가능한 세컨더리가 프라이머리를 따라잡을 때까지 기다리는 시간(초)입니다.

지정되면 secondaryCatchUpPeriodSecs 가 기본 대기 시간인 10 초를 재정의하고, force: true 인 경우에는 0 초를 재정의합니다.

force

부울

선택 사항. 대기 기간 내에 선택 가능한 최신 세컨더리가 없는 경우 프라이머리가 강등할지 여부를 결정하는 부울입니다.

true 인 경우 적합한 세컨더리 멤버가 없더라도 프라이머리가 강등됩니다. 이로 인해 복제 지연이 있는 보조 서버가 새 기본 서버가 되는 경우 롤백 이 발생할 수 있습니다.

false 인 경우, 적합한 세컨더리 멤버가 없으면 프라이머리가 강등되지 않고 명령이 오류를 반환합니다.

기본값은 false입니다.

The replSetStepDown command attempts to terminate long running user operations that block the primary from stepping down, such as an index build, a write operation or a map-reduce job.

그런 다음 명령은 세컨더리가 프라이머리와 최신 상태가 될 때까지 최대 secondaryCatchUpPeriodSeconds 초(기본값 10초)까지 기다리는 따라잡기 기간을 시작합니다. 롤백을 방지하기 위해 따라잡기 기간 동안 세컨더리가 프라이머리를 최신 상태로 유지하는 경우에만 프라이머리가 단계적으로 강등됩니다.

If no electable secondary meets this criterion by the end of the waiting period, the primary does not step down and the command errors. 이 동작을 재정의하고 force: true 옵션으로 명령을 실행하여 프라이머리를 즉시 물러나게 할 수 있습니다.

프라이머리가 성공적으로 강등되면 해당 노드는 명령을 받은 시점부터 시작된 replSetStepDown: <seconds> 기간의 나머지 기간 동안 프라이머리가 될 수 없습니다.

replSetStepDown 이 명령은 모든 클라이언트 연결을 닫지 않습니다.

참고

All writes to the primary fail during the period starting when the replSetStepDown command is received until either a new primary is elected, or if there are no electable secondaries, the original primary resumes normal operation.

Writes that were in progress when replSetStepDown is run are killed. In-progress transactions also fail with TransientTransactionError and can be retried as a whole.

쓰기가 실패하는 최대 기간은 다음과 같습니다.

secondaryCatchUpPeriodSecs (기본 10초) + electionTimeoutMillis(기본 10초)

When you step down a primary using rs.stepDown() or replSetStepDown without setting the force field to true, the stepped-down primary nominates an eligible secondary to call an election immediately.

현재 프라이머리에서 실행되는 다음 예시는 120 초 동안 멤버를 강등하려고 시도합니다.

The operation waits up to the default 10 seconds for a secondary to catch up. 적합한 세컨더리가 없는 경우 프라이머리가 강등되지 않고 명령에 오류가 발생합니다.

참고

All writes to the primary fail during the period starting when the replSetStepDown command is received until either a new primary is elected, or if there are no electable secondaries, the original primary resumes normal operation.

Writes that were in progress when replSetStepDown is run are killed. In-progress transactions also fail with TransientTransactionError and can be retried as a whole.

쓰기가 실패하는 최대 기간은 다음과 같습니다.

secondaryCatchUpPeriodSecs (기본 10초) + electionTimeoutMillis(기본 10초)

db.adminCommand( { replSetStepDown: 120 } )

현재 프라이머리에서 실행되는 다음 예제는 120 초 동안 멤버를 강등하려고 시도하고, 선택 가능한 세컨더리가 따라잡을 때까지 최대 15 초까지 기다립니다. 적합한 세컨더리가 없는 경우 프라이머리가 강등되지 않고 명령에 오류가 발생합니다.

참고

All writes to the primary fail during the period starting when the replSetStepDown command is received until either a new primary is elected, or if there are no electable secondaries, the original primary resumes normal operation.

Writes that were in progress when replSetStepDown is run are killed. In-progress transactions also fail with TransientTransactionError and can be retried as a whole.

쓰기가 실패하는 최대 기간은 다음과 같습니다.

secondaryCatchUpPeriodSecs (기본 10초) + electionTimeoutMillis(기본 10초)

db.adminCommand( { replSetStepDown: 120, secondaryCatchUpPeriodSecs: 15 } )

현재 프라이머리에서 실행되는 다음 예제는 120 초 동안 멤버를 강등하려고 시도하고, 선택 가능한 세컨더리가 따라잡을 때까지 최대 15 초까지 기다립니다. force: true 옵션으로 인해 적합한 세컨더리가 없더라도 프라이머리가 강등됩니다.

참고

All writes to the primary fail during the period starting when the replSetStepDown command is received until either a new primary is elected, or if there are no electable secondaries, the original primary resumes normal operation.

Writes that were in progress when replSetStepDown is run are killed. In-progress transactions also fail with TransientTransactionError and can be retried as a whole.

쓰기가 실패하는 최대 기간은 다음과 같습니다.

secondaryCatchUpPeriodSecs (기본 10초) + electionTimeoutMillis(기본 10초)

db.adminCommand( { replSetStepDown: 120, secondaryCatchUpPeriodSecs: 15, force: true } )
이 페이지 평가하기