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

mongomirror

경고

mongomirror을 네임스페이스 필터와 함께 사용하는 경우, includeNamespace <database.collection>의 범위를 벗어난 네임스페이스가 있는 소스의 트랜잭션은 정의되지 않은 동작으로 간주되어 잠재적인 데이터 손실을 초래합니다.

mongomirror 는 기존 MongoDB 복제본 세트에서 MongoDB Atlas 복제본 세트로 데이터를 수동으로 마이그레이션하는 도구입니다. mongomirror 다운로드를 참조하세요.

mongomirror을(를) 실행하려면 다음을 지정해야 합니다.

  • 소스 복제본 세트와 대상 Atlas 복제본 세트

  • 소스 복제본 세트에 인증이 필요한 경우, 적절한 권한, 해당 비밀번호, 적절한 권한을 가진 Atlas 클러스터의 사용자

mongomirror --host <sourceReplSet> \
--destination <atlasCluster> \
--destinationUsername <atlasAdminUser> \
--destinationPassword <atlasPassword> \
[Additional options]

You can specify some options in the config file instead of including them in the command.

--host <host>

소스 복제본 세트의 호스트 정보입니다. 다음과 같이 복제본 세트 이름과 노드의 시드 목록을 지정합니다.

<RSname>/<host1>:<port1>,<host2>:<port2>,<host3>:<port3>
--username <username>

If the source replica set requires authentication, the name of a user in the source replica set with privileges to read any database, including the local database. A user with the backup role provides the appropriate privileges. For details on the specific privileges required, see Required Access on Source Replica Set.

--password <password>

--username에 지정된 사용자의 비밀번호

--authenticationDatabase <authenticationDatabase>

--username에 지정된 사용자가 생성된 소스 복제본 세트의 데이터베이스입니다. 다음에 대한 인증 데이터베이스입니다.

  • SCRAM 인증 사용자는 admin 데이터베이스입니다.

  • X.509 인증 사용자는 $external 데이터베이스입니다.

  • AWS IAM 인증 사용자는 $external 데이터베이스입니다.

To learn more, see Authentication Database.

--authenticationMechanism <authenticationMechanism>

소스 복제본 세트에 대해 사용자를 인증하는 데 사용하는 인증 메커니즘입니다.

값
설명

MongoDB TLS/SSL 인증서 인증.

GSSAPI (Kerberos)

External authentication using Kerberos. This mechanism is available only in MongoDB Enterprise.

PLAIN (LDAP SASL)

External authentication using LDAP. You can also use PLAIN for authenticating in-database users. PLAIN transmits passwords in plain text. This mechanism is available only in MongoDB Enterprise.

MONGODB-IAM

버전 0.10.0의 새로운 기능

Amazon Web Services IAM을 사용한 외부 인증 .

AWS IAM 자격 증명으로 인증하려면 다음 옵션을 사용하세요.

To learn more, see Authentication Mechanisms.

--awsSessionToken

버전 0.10.0의 새로운 기능

MONGODB-IAM 인증 메커니즘과 함께 사용하기 위한 AWS 세션 토큰입니다.

--compressors <snappy,...>

버전 1.5.0의 새로운 기능

활성화할 압축기 목록을 쉼표로 구분합니다. 비활성화하려면 'none'을 사용하세요. 기본값: snappy,zstd,zlib

--config=<file>

mongomirror의 옵션과 값을 저장하는 YAML 파일입니다. 상대 경로 또는 절대 경로를 사용하여 mongomirror 파일에 포함된 옵션과 함께 실행할 파일을 지정합니다.

구성 파일은 다음 옵션을 지원합니다.

option: value 구문을 사용하여 구성 파일에서 옵션을 지정합니다. 구성 파일의 옵션 앞에 --을(를) 포함하지 마세요. 구성 파일에 옵션을 설정한 경우 mongomirror 명령어 내에서 해당 옵션을 지정할 필요가 없습니다.

예시

다음을 포함하는 myconfig.yaml(이)라는 구성 파일을 만듭니다.

password: <passwordForUser>
destinationPassword: <passwordForDestinationUser>

--password 및 --destinationPassword 플래그를 포함하지 않고 mongomirror를 실행할 수 있습니다.

mongomirror --host <sourceReplSet> \
--ssl \
--username <atlasAdminUser> \
--destinationUsername <atlasAdminUser> \
--config=myconfig.yaml \
--destination <atlasCluster> \
[Additional options]
--destination <destination>

대상 Atlas 복제본 세트의 호스트 정보입니다.

다음과 같이 복제본 세트 이름과 노드의 시드 목록을 지정합니다.

<RSname>/<host1>:<port1>,<host2>:<port2>,<host3>:<port3>
--destinationAuthenticationDatabase <authentication database>

Authentication database for the database user in the Atlas cluster. The authentication database for SCRAM-authenticated users is the admin database.

자세한 내용은 데이터베이스 사용자 인증을 참조하세요.

--destinationAuthenticationMechanism <authentication mechanism>

Atlas 클러스터의 데이터베이스 사용자를 위한 인증 메커니즘입니다. Atlas는 데이터베이스 사용자를 위해 다음과 같은 인증 형식을 제공합니다.

값
설명

PLAIN (LDAP SASL)

External authentication using LDAP. You can also use PLAIN for authenticating in-database users. PLAIN transmits passwords in plain text. This mechanism is available only in MongoDB Enterprise.

자세한 내용은 데이터베이스 사용자 인증을 참조하세요.

--destinationUsername <Atlas user name>

데이터베이스를 읽고, 쓰고, 관리할 수 있는 권한이 있는 Atlas 클러스터의 데이터베이스 사용자 이름입니다. Atlas 관리자 역할이 있는 사용자는 적절한 권한을 제공합니다. 필요한 특정 권한에 대한 자세한 내용은 대상 클러스터에 필요한 액세스권한을 참조하세요.

--destinationPassword <password>

--destinationUsername에 지정된 데이터베이스 사용자의 비밀번호입니다.

--drop

Flag that indicates that mongomirror should drop all user collections (viewable in each database with listCollections) on the target cluster. This option doesn't drop internal collections like local.system* and the oplog.

--noIndexRestore

버전 0.10.0의 새로운 기능

데이터 마이그레이션 시 인덱스를 생략합니다.

--includeNamespace <database.collection>

소스 클러스터에서 대상 클러스터에 미러링할 네임스페이스를 지정합니다. 여러 차례 제공될 수 있습니다.

참고

If a transaction spans multiple namespaces, only write operations applied to the namespaces specified in --includeNamespace or --includeDB are applied to the destination cluster.

--includeDB <database>

소스 클러스터에서 대상 클러스터에 미러링할 데이터베이스를 지정합니다. 여러 차례 제공될 수 있습니다.

참고

If a transaction spans multiple namespaces, only write operations applied to the namespaces specified in --includeNamespace or --includeDB are applied to the destination cluster.

--ssl

소스 복제본 세트에 대한 TLS/SSL 암호화 연결을 활성화합니다.

--sslPEMKeyFile <file>

소스 복제본 세트에서 클라이언트가 인증서를 제시해야 하는 경우에 해당하는 .pem 파일입니다..pem 파일에는 TLS/SSL 인증서 및 키가 모두 포함되어 있습니다.상대 경로 또는 절대 경로를 사용하여 파일을 지정합니다.

--sslPEMKeyPassword <value>

--sslPEMKeyFile에 지정된 인증서 키 파일을 해독하기 위한 비밀번호입니다. --sslPEMKeyFile이(가) 암호화된 경우 사용합니다.

--sslCAFile <file>

소스 복제본 세트에 대한 인증 기관(CA)의 최상위 인증서 체인이 포함된 .pem 파일입니다. 상대 경로 또는 절대 경로를 사용하여 파일을 지정합니다.

--sslCRLFile <filename>

소스 복제본 세트에 대한 인증서 해지 목록이 포함된 .pem 파일입니다. 상대 경로 또는 절대 경로를 사용하여 파일을 지정합니다.

--sslAllowInvalidHostnames

더 이상 사용되지 않습니다. 다음을 사용하세요. tlsInsecure 대신

Disables the validation of the TLS/SSL certificates presented by the source replica set. Allows mongomirror to connect to the source replica set if the hostname in the certificates does not match the specified hostname.

중요

이 옵션은 모든 인증서 유효성 검사를 건너뛰므로 잘못된 인증서를 수락하게 될 수도 있습니다.

--sslAllowInvalidCertificates

더 이상 사용되지 않습니다. 다음을 사용하세요. tlsInsecure 대신

소스 복제본 세트에서 제공하는 인증서에 대한 유효성 검사를 우회합니다. --allowInvalidCertificates 설정을 사용할 때 MongoDB는 유효하지 않은 인증서 사용에 대한 경고를 로그합니다.

중요

이 옵션은 모든 인증서 유효성 검사를 건너뛰므로 잘못된 인증서를 수락하게 될 수도 있습니다.

--tlsInsecure

서버의 인증서 체인 및 호스트 이름에 대한 유효성 검사를 건너뜁니다. 이렇게 하면 잘못된 인증서 및 호스트 이름을 사용할 수 있습니다.

이는 지원이 중단된 sslAllowInvalidHostnames 및 sslAllowInvalidCertificates 옵션을 대체합니다.

--gssapiServiceName <name>

소스 복제본 세트가 Kerberos 인증을 사용하는 경우 GSSAPI/Kerberos를 사용하는 서비스의 이름입니다. 서비스가 기본 이름인 mongodb을(를) 사용하지 않는 경우에만 필요합니다.

이 옵션은 MongoDB Enterprise에서만 사용할 수 있습니다.

--gssapiHostName <host>

소스 복제본 세트가 Kerberos 인증을 사용하는 경우 GSSAPI/Kerberos를 사용하는 서비스의 호스트 이름입니다. 시스템의 호스트 이름이 DNS에서 확인한 호스트 이름과 일치하지 않는 경우에만 필요합니다.

이 옵션은 MongoDB Enterprise에서만 사용할 수 있습니다.

--readPreference <read preference>

버전 0.9.0부터 더 이상 사용되지 않음

mongomirror 소스가 복제본 세트 이름이 없는 단일 호스트인 경우를 제외하고는 항상 프라이머리에서 읽습니다. 이 경우 해당 호스트에만 직접 연결됩니다.

--writeConcern <write concern>

0.2.3 버전부터 더 이상 사용되지 않습니다. mongomirror 항상 과반수 쓰기 고려를 사용합니다.

--numParallelCollections <num>, -j <num>

기본값: 4

병렬로 복사 및 복원할 컬렉션의 수입니다.

--bypassDocumentValidation

0.2.3 버전부터 더 이상 사용되지 않습니다. mongomirror 항상 문서 유효성 검사를 건너뜁니다.

--bookmarkFile <file>

기본값: mongomirror.bookmark

oplog 타임스탬프 북마크 파일의 이름입니다.

--forceDump

Flag that indicates that mongomirror resync all source collections, even if a nonempty bookmark file exists.

--oplogPath <path>

버전 0.5.0의 새로운 기능

Enables mongomirror to buffer the initial sync oplog window to disk. When you specify a value for this option, mongomirror streams the source oplog entries to the specified directory in a single file: <oplogPath>/oplog-mongomirror.bson.sz. After the entire oplog file is replayed to the destination cluster, mongomirror removes the file and starts tailing the source oplog without buffering.

By default, mongomirror streams oplog entries from the source and applies them to the destination cluster. However, the migration may fail if the source oplog is not large enough to contain the entire initial sync oplog window. To avoid this error, you can either increase the size of the source oplog, or specify this option to ensure that the source oplog will not run out of space during the migration process.

중요

There must be enough disk space to accommodate all of the source oplog entries that occur during the initial mongomirror sync.

For example, if the source oplog is 10 GB and covers 24 hours of changes, and mongomirror's sync is estimated to take 48 hours, there must be at least 20 GB of free disk space in the specified directory.

--oplogBatchSize <num>

기본값: 10,000

Specify the number of oplog entries to send as a batch. mongomirror allows up to a maximum data volume size of 16 MB of documents to send as a batch.

--httpStatusPort <num>

Directs mongomirror to start an HTTP server on the specified port. You can retrieve the current status of mongomirror by issuing an HTTP GET request to http://localhost:<num>.

When running with --httpStatusPort, mongomirror does not exit when it encounters an error. Instead, it logs the error as normal and reports the error over HTTP to the specified port.

mongomirror HTTP 요청에 대한 응답으로 문서를 반환합니다.다음 예시 구문은 가능한 모든 출력 필드를 나타내며, 실제 응답은 이러한 필드의 하위 집합만 반환할 수 있습니다.필드에 대한 설명과 예상 시기는 다음 표를 참조하세요.

{
"stage" : "<stage Name>",
"phase" : "<phase Name>",
"details" : {
"currentTimestamp" : "<BSON timestamp>",
"latestTimestamp" : "<BSON timestamp>",
"lastWriteOnSourceTimestamp" : "<BSON timestamp>",
"<namespace>" : {
"complete" : <boolean>,
"copiedBytes" : <integer>,
"totalBytes" : <integer>,
"createIndexes" : <integer>
},
...
},
"errorMessage" : "<error message>"
}

다음 표에서는 각 필드와 사용 가능한 값에 대해 설명합니다:

필드
설명

stage

진행 중인 단계의 이름입니다. 가능한 값은 다음과 같습니다.

  • initializing

    mongomirror 시작되었지만 아직 어떤 데이터도 복사하고 있지 않습니다.

  • initial sync

    mongomirror is copying documents and indexes that already exist on the source deployment. mongomirror also tails and applies entries from the oplog.

  • oplog sync

    mongomirror oplog의 엔트리를 테일링하여 적용하고 있습니다.

phase

단계의 이름입니다. stage의 어떤 부분이 진행 중인지에 대한 보다 구체적인 세부 정보를 제공합니다.

details

현재 단계의 진행 상황에 대한 자세한 설명을 제공하는 문서입니다.

During the initial sync stage, each subdocument in details represents a single collection being copied by mongomirror.

stage 또는 phase에 따라 mongomirror가 응답에 이 필드를 포함하지 않을 수도 있습니다.

details.<namespace>

복사되는 컬렉션의 전체 네임스페이스이며 <database>.<collection>(으)로 표시됩니다.

문서 또는 인덱스를 복사할 때 initial sync 단계에서만 표시됩니다.

details.<namespace>.complete

Displays true or false depending on whether or not mongomirror has copied all documents or indexes from the collection to the target Atlas cluster.

문서 또는 인덱스를 복사할 때 initial sync 단계에서만 표시됩니다.

details.<namespace>.copiedBytes

지금까지 복사된 바이트 수입니다. 이는 복사된 현재의 mongomirror 총 문서 수를 보고하는 로그와는 다른 측정값입니다.

비인덱스 데이터를 복사할 때 initial sync 단계 중에만 표시됩니다.

details.<namespace>.totalBytes

collection의 총 크기(바이트)입니다.

비인덱스 데이터를 복사할 때 initial sync 단계 중에만 표시됩니다.

details.<namespace>.createIndexes

생성되었거나 생성될 인덱스의 수입니다.

인덱스를 복사할 때 initial sync 단계에서만 표시됩니다.

details.currentTimestamp

The BSON timestamp value of the oplog entry most recently processed. mongomirror only refreshes this data point every 10 seconds, so mongomirror may be slightly further ahead of the reported time.

oplog 엔트리를 테일링하거나 적용할 때 initial sync 또는 oplog sync 단계 동안에만 표시됩니다.

details.latestTimestamp

initial sync 단계에서 이는 초기 동기화 중에 초기 데이터가 복사된 후 사용할 수 있는 최신 oplog 항목의 BSON 타임스탬프 값을 나타냅니다.

oplog sync 단계에서는 소스 배포에서 사용할 수 있는 최신 oplog 항목의 BSON 타임스탬프 값을 나타냅니다.

oplog 엔트리를 테일링하거나 적용할 때 initial sync 또는 oplog sync 단계 동안에만 표시됩니다.

details
.lastWriteOnSourceTimestamp

The BSON timestamp value of the most recent oplog entry that is not a no-op. No-op entries are generally system-level operations such as heartbearts that do not write or edit data in the database. mongomirror refreshes this value every 10 seconds. Operations which write or edit data in the database may not be reported until the next refresh occurs.

lastWriteOnSourceTimestamp 필드는 마이그레이션 중에 전환하기 전에 소스 배포에서 새로운 쓰기가 발생하지 않음을 확인하는 데 유용합니다.

errorMessage

A string that describes any error encountered by mongomirror.

--collStatsThreshold <num>

버전 1.5.0의 새로운 기능

Maximum number of collections which may exist before collStats is disabled. Use -1 to always run collStats or 0 to never run collStats. Default: -1

--removeAutoIndexId

버전 0.12.0의 새로운 기능

대상 클러스터에 대한 초기 동기화 중에 컬렉션에서 autoIndexId 옵션을 제거합니다. 또한 마이그레이션 중에 mongomirror이(가) 생성하는 모든 컬렉션에서 autoIndexId 옵션을 제거합니다.

--preserveUUIDs

Atlas가 실시간 마이그레이션 중에 UUID를 유지하도록 허용합니다. 이 옵션은 오직 Atlas에서 실행하는 실시간 마이그레이션 프로세스에서만 작동합니다. 명령줄에서 --preserveUUIDs 옵션을 사용하면 권한 오류로 인해 실패하게 됩니다. 해당 옵션은 mongomirror를 실행하는 자체 관리형 마이그레이션 프로세스의 명령줄에서 사용하기 위한 것이 아니므로, 오류를 예상할 수 있습니다.

다음 예에서는 인증이 필요하지 않은 소스 복제본 세트에서 마이그레이션합니다.

mongomirror --host sourceRS/source-host1:27017,source-host2:27017 \
--destination myAtlasRS/atlas-host1:27017,atlas-host2:27017 \
--destinationUsername myAtlasUser \
--destinationPassword myAtlasPwd

인증이 필요하지 않은 소스 복제본 세트에서 마이그레이션하려면 다음 옵션을 사용하여 mongomirror을(를) 실행합니다.

대상의 경우 다음 형식으로 복제본 세트 이름과 그 뒤에 노드의 시드 목록을 지정합니다.

<replicaSetName>/<host1>:<port1>,<host2>:<port2>,<host3>:<port3>,...

The specified user must have the Atlas admin role on Atlas.

다음 예에서는 SCRAM-SHA1 인증을 사용하는 소스 복제본 세트를 Atlas로 마이그레이션합니다.

mongomirror --host sourceRS/source-host1:27017,source-host2:27017,source-host3:27017 \
--username mySourceUser \
--password mySourcePassword \
--authenticationDatabase admin \
--destination myAtlasRS/atlas-host1:27017,atlas-host2:27017 \
--destinationUsername myAtlasUser \
--destinationPassword atlasPassw0Rd

To migrate from a source replica set that uses SCRAM-SHA1 authentication, run mongomirror with the following options:

소스 복제본 세트 사용자는 소스 클러스터에 필요한 액세스 권한이 있어야 합니다. backup 역할은 적절한 권한을 제공합니다.

대상의 경우 다음 형식으로 복제본 세트 이름과 그 뒤에 노드의 시드 목록을 지정합니다.

<replicaSetName>/<replicaMember>,<replicaMember>,<replicaMember>,...

The specified user must have the Atlas admin on Atlas.

다음 예에서는 X.509 인증을 사용하는 소스 복제본 세트에서 마이그레이션합니다.

mongomirror --host sourceRS/source-host1:27017,source-host2:27017,source-host3:27017 \
--username "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry" \
--authenticationDatabase '$external' \
--authenticationMechanism MONGODB-X509 \
--ssl \
--sslPEMKeyFile <path-to-my-client-certificate.pem> \
--sslCAFile <path-to-my-certificate-authority-certificate.pem> \
--destination myAtlasRS/atlas-host1:27017,atlas-host2:27017 \
--destinationUsername myAtlasUser \
--destinationPassword atlasPassw0Rd

To migrate from a source replica set that uses X.509 authentication, run mongomirror with the following options:

소스 복제본 세트 사용자는 소스 클러스터에 필요한 액세스 권한이 있어야 합니다. backup 역할은 적절한 권한을 제공합니다.

대상의 경우 다음 형식으로 복제본 세트 이름과 그 뒤에 노드의 시드 목록을 지정합니다.

<replicaSetName>/<replicaMember>,<replicaMember>,<replicaMember>,...

The specified user must have the Atlas admin on Atlas.

다음 예에서는 Kerberos 인증을 사용하는 소스 복제본 세트에서 마이그레이션합니다.

mongomirror --host sourceRS/source-host1:27017,source-host2:27017,source-host3:27017 \
--username sourceUser/administrator@MYREALM.COM \
--authenticationDatabase '$external' \
--authenticationMechanism GSSAPI \
--destination myAtlasRS/atlas-host1:27017,atlas-host2:27017,atlas-host3:27017 \
--destinationUsername atlasUser \
--destinationPassword atlasPass

To migrate from a source replica set that uses Kerberos authentication, run mongomirror with the following options:

소스 복제본 세트 사용자는 소스 클러스터에 필요한 액세스 권한이 있어야 합니다. backup 역할은 적절한 권한을 제공합니다.

대상의 경우 다음 형식으로 복제본 세트 이름과 그 뒤에 노드의 시드 목록을 지정합니다.

<replicaSetName>/<replicaMember>,<replicaMember>,<replicaMember>,...

The specified user must have the Atlas admin on Atlas.

나중에 검사하고 디버깅하기 위해 mongomirror 절차의 출력 로그를 파일에 저장할 수 있습니다. 다음 형식을 사용하여 mongomirror.log 파일에 출력을 저장합니다.

mongomirror <args> 2>&1 | tee -a mongomirror.log
이 페이지 평가하기

이 페이지의 내용