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

두 개의 Atlas cluster 연결

mongosync 유틸리티는 MongoDB 클러스터 간에 연결을 생성합니다. mongosync 는 다음 클러스터 중 하나에 연결할 수 있습니다.

이 페이지에서는 MongoDB Mongosync를 사용하여 Atlas 클러스터를 연결하는 방법에 대해 설명합니다. Atlas cluster 연결에 대한 자세한 내용은 데이터베이스 배포에 연결을 참조하세요.

  • 소스 및 대상 Atlas 클러스터는 모두 MongoDB 6.0 이상을 사용해야 합니다.

  • mongosync 복제본 세트와 샤딩된 클러스터를 지원합니다.

  • mongosync Atlas 공유 클러스터 또는 서버리스 인스턴스를 지원 하지 않습니다 . mongosync 는 M10 이상의 Atlas 클러스터에서만 사용할 수 있습니다.

mongosync MongoDB URI 연결 string 을 사용하여 Atlas 클러스터를 연결합니다.

  • SRV 연결 체계의 형식은 다음과 같습니다.

    mongodb+srv://[username:password]@[clusterName].[host].mongodb.net/

    에서 SRV 연결 을 찾는 방법에 대한 자세한 string Atlas 내용은 클러스터에 연결을 참조하세요.

  • 표준 URI 연결 체계의 형식은 다음과 같습니다.

    mongodb://[username:password]@[clusterName].[host].mongodb.net/

mongosync primary 소스 및 대상 클러스터에 연결하려면 읽기 설정 (read preference) 필요합니다. 자세한 내용은 읽기 기본 설정 옵션을 참조하세요.

유효한 인증 을 제공하여 MongoDB Atlas 클러스터 에 연결합니다. 아직 Atlas 데이터베이스 사용자가 없는 경우 사용자를 만들어야 합니다.

mongosync 연결 문자열 에 지정된 사용자에게는 소스 및 대상 클러스터에 대한 필수 권한이 있어야 합니다. 권한은 환경과 쓰기 차단 설정을 수정하려는지 또는 역 동기화 사용하려는지 여부에 따라 달라집니다.

Atlas 권한은 다음과 같습니다.

동기화 유형
필수 소스 권한
필수 대상 권한

기본값

  • atlasAdmin

이중 쓰기 차단, 반전 또는 다중 반전

Atlas 역할에 대한 자세한 내용은 Atlas User Role을 참조하세요.

Atlas user 권한을 업데이트 하려면 프로젝트에 대한 액세스 관리를 참조하세요.

The mongosync utility can be hosted on its own hardware close to either the source or destination cluster. It does not have to be hosted on the same server as one of the mongod or mongos instances in the cluster. This flexibility allows you to push, or pull, data to the destination cluster with minimal impact on the mongod or mongos instances running there.

mongosync 가 연결되면 IDLE 상태가 됩니다. 동기화를 시작하려면 시작 명령을 실행해야 합니다.

Atlas cluster 로 를 실행 하기 전에 mongosync M10+ Require Indexes for All Queries 옵션을 notablescan false 비활성화하여 소스 클러스터와 대상 클러스터 모두에서 을(를)(으)로 설정하다 .

일반 연결 문자열 형식은 다음과 같습니다.

mongodb://<user>:<password>@<clusterName>.<hostname>.mongodb.net/

Atlas UI 에서 Atlas cluster에 대한 연결 문자열 가져올 수 있습니다. 자세한 학습 은 데이터베이스 배포에 연결을 참조하세요.

cluster0cluster1 에 대해 수집한 연결 문자열은 다음과 유사해야 합니다.

cluster0:
mongodb+srv://clusterAdmin:superSecret@cluster1Name.abc123.mongodb.net
cluster1:
mongodb+srv://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net

클러스터가 포함된 프로젝트 에 비밀번호가 superSecret 인 데이터베이스 관리 사용자 clusterAdmin 가 있습니다.

아래의 mongosync 명령 레이아웃은 표시되도록 수정되었습니다. mongosync 을 사용하여 cluster0cluster1 에 연결하려면 다음 명령을 한 줄에 입력합니다.

mongosync \
--cluster0 "mongodb+srv://clusterAdmin:superSecret@cluster1Name.abc123.mongodb.net" \
--cluster1 "mongodb+srv://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net"

Atlas 클러스터에는 TLS 연결이 필요합니다.mongosync Atlas 클러스터에서 를 tls=true 사용하려면 옵션을 추가합니다. 예시 admin cluster0 들어 및 cluster1 에서 데이터베이스 에 연결하려면 다음을 수행합니다.

mongosync \
--cluster0 "mongodb+srv://clusterAdmin:superSecret@cluster1Name.abc123.mongodb.net/admin?tls=true" \
--cluster1 "mongodb+srv://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net/admin?tls=true"

와 함께 연결 문자열을 사용할 수도 mongodb+srv mongosync 있습니다. 연결 문자열 에 옵션을 추가할 필요가 tls=true mongodb+srv 없습니다. 예시 들면 다음과 같습니다.

mongosync \
--cluster0 "mongodb+srv://clusterAdmin:superSecret@cluster1Name.abc123.mongodb.net/" \
--cluster1 "mongodb+srv://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net/"

mongodb+srv 연결 문자열에 대한 자세한 내용은 SRV 연결 형식을 참조하세요.

이 페이지 평가하기