featureCompatibilityVersion (fCV) 및 메이저 업그레이드 순서 확인
MongoDB업그레이드명령어
// 1) Current fCV (must be the same on all members; targetVersion appears if a transition is incomplete):
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
// 2) Upgrade binaries in a rolling fashion (secondaries -> stepDown -> old primary); fCV stays old
db.version()
// 3) After the observation period, raise fCV on the primary (on mongos in a sharded cluster):
db.adminCommand({ setFeatureCompatibilityVersion: "7.0", confirm: true })
// 4) If a rollback is needed, fCV is lowered BEFORE the binaries:
db.adminCommand({ setFeatureCompatibilityVersion: "6.0", confirm: true })하는 일
실행 중인 fCV를 보여 주고, 별도 단계인 바이너리 업그레이드와 fCV 업그레이드를 수행하는 순서를 제공한다.
사용 시점
메이저 버전 업그레이드(예: 6.0 -> 7.0)를 계획할 때, 업그레이드 후 새 기능을 사용할 수 없을 때, 또는 다음 메이저로 넘어가기 전.
주의
메이저 버전은 건너뛸 수 없다: 5.0 -> 7.0은 먼저 6.0으로 옮기고 fCV를 6.0으로 설정한다. fCV를 올리면 데이터 파일이 새 형식으로 바뀔 수 있어 바이너리 다운그레이드가 어려워지므로 새 버전이 며칠간 문제없이 동작한 뒤에만 fCV를 올린다. 7.0+ Community에서는 바이너리 다운그레이드가 공식 지원되지 않으므로 대비책은 백업을 기반으로 한다. 업그레이드 전에 드라이버 호환성을 확인한다.