자체 관리형 독립형을 WiredTiger 로 변경
참고
WiredTiger로 업그레이드해야 합니다. MongoDB는 버전 4.2에서 더 이상 사용되지 않는 MMAPv1 스토리지 엔진을 제거했습니다.
Use this tutorial to change the storage engine of a 독립형 MongoDB instance to wiredTiger.
고려 사항
mongodump
및 mongorestore
This tutorial uses the mongodump
and
mongorestore
utilities to export and import data.
로컬 호스트에 기본 바인딩
2} 및mongod
mongos
MongoDB localhost
바이너리는 기본적으로 에 바인딩됩니다.
The tutorial runs mongodump
and
mongorestore
from the same host as the
mongod
they are connecting to. If run remotely,
mongodump
and mongorestore
must specify
the ip address or the associated hostname in order to connect to the
mongod
.
XFS 및 WiredTiger
WiredTiger 스토리지 엔진의 경우, Linux에서는 데이터 저장 노드에 XFS를 사용하는 것이 좋습니다. 자세한 내용은 커널 및 파일 시스템을 참조하세요.
MMAPv1 전용 제한 사항
WiredTiger로 업그레이드하면 WiredTiger 배포에는 다음과 같은 MMAPv1 전용 제한 사항이 적용되지 않습니다:
MMAPv1 제한 사항 | 짧은 설명 |
---|---|
네임스페이스 수 | MMAPv1의 경우 네임스페이스 수는 네임스페이스 파일 크기를 628로 나눈 값으로 제한됩니다. |
네임스페이스 파일 크기 | MMAPv1의 경우 네임스페이스 파일은 2047메가바이트를 넘지 않아야 합니다. |
데이터베이스 크기 | MMAPv1 스토리지 엔진은 각 데이터베이스를 16,000개 이하의 데이터 파일로 제한합니다. |
데이터 크기 | MMAPv1의 경우 단일 |
데이터베이스의 컬렉션 수 | MMAPv1 스토리지 엔진의 경우, 데이터베이스 내 컬렉션의 최대 수는 네임스페이스 파일의 크기와 데이터베이스 내 컬렉션의 인덱스 수에 따라 결정됩니다. |
절차
Start the mongod
you wish to change to WiredTiger.
If mongod
is already running, you can skip this step.
Export data using mongodump
.
mongodump --out=<exportDataDestination>
Specify additional options as appropriate, such as username and
password if running with authorization enabled. See
mongodump
for available options.
Create a data directory for the new mongod
running with WiredTiger.
Create a data directory for the new mongod
instance that
will run with the WiredTiger storage engine. mongod
must have read
and write permissions for this directory.
WiredTiger 를 사용하는 mongod
는 다른 스토리지 엔진 으로 생성된 데이터 파일로 시작되지 않습니다.
WiredTiger의 구성을 업데이트합니다.
mongod
인스턴스 구성에서 모든 MMAPv1 구성 옵션을 제거하세요.
WiredTiger로 mongod
을(를) 시작합니다.
시작하기 mongod
, specifying wiredTiger
as the
--storageEngine
and the newly
created data directory for WiredTiger as the --dbpath
.
필요에 따라 추가 옵션을 지정합니다(예: --bind_ip
).
경고
인스턴스를 공개적으로 접근 가능한 IP 주소에 바인딩하기 전에 무단 접근으로부터 클러스터를 보호해야 합니다. 보안 권장 사항의 전체 목록은 자체 관리 배포서버에 대한 보안 검사 목록을 참조하세요. 최소한 인증을 활성화하고 네트워크 인프라를 강화하는 것을 고려합니다.
mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath> --bind_ip localhost,<hostname(s)|ip address(es)>
구성 파일에서 옵션을 지정할 수도 있습니다. 스토리지 엔진을 지정하려면 storage.engine
설정을 사용합니다.
Upload the exported data using mongorestore
.
mongorestore <exportDataDestination>
Specify additional options as appropriate. See
mongorestore
for available options.