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

자체 managed cluster를 Atlas에 연결

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

이 페이지에서는 MongoDB Mongosync를 사용하여 자체 관리 클러스터 Atlas cluster 에 연결하는 방법에 대해 설명합니다.

Atlas 클러스터 연결에 대한 자세한 내용은 데이터베이스 배포서버에 연결참조하세요.

참고

최상의 성능을 위해 자체 관리형 클러스터 에서 마이그레이션 하기 전에 최신 MongoDB Server 패치 출시하다 로 업그레이드 하세요. 자세한 내용 은 MongoDB 의 최신 자체 관리 패치 릴리스로 업그레이드를 참조하세요.

mongosync MongoDB URI 연결 string 을 사용하여 자체 관리형 클러스터를 연결합니다.

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

    mongodb+srv://[username:password@][host.domain.TLD][/defaultauthdb][?options]
  • 표준 URI 연결 체계의 형식은 다음과 같습니다.

    mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]

Specify the hostnames of the mongod instances the same way that they are listed in your replica set configuration.

For sharded clusters, specify the hostnames of the mongos instances instead of the mongod instances.

참고

mongosync does not require the replicaSet option.

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 requires the primary read preference to connect to the source and destination clusters. For more information, see Read Preference Options.

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

소스 또는 대상 cluster에 인증이 필요한 경우 mongosync 호출할 때 올바른 자격 증명을 제공해야 합니다.

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

소스 클러스터 에 대한 자체 관리형 권한은 다음과 같습니다.

서버 역할에 대한 자세한 내용은 자체 관리형 배포서버의 역할 기반 액세스 제어를 참조하세요.

To update user permissions, see: grantRolesToUser.

대상 클러스터 에 대한 Atlas 권한은 다음과 같습니다.

동기화 유형
필수 대상 권한

기본값

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

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 상태가 됩니다. 동기화를 시작하려면 시작 명령을 실행해야 합니다.

Before you attempt to run mongosync with an M10+ Atlas cluster, disable the Require Indexes for All Queries option to set notablescan to false on both the source and destination clusters.

소스 클러스터cluster0 은(는) 다음 서버 및 포트에서 호스팅됩니다.

  • clusterOne01.fancyCorp.com:20020

  • clusterOne02.fancyCorp.com:20020

  • clusterOne03.fancyCorp.com:20020

대상 Atlas 클러스터 cluster1 는 다음 서버 및 포트에서 호스팅됩니다.

  • cluster2Name-01.abc123.com:27017

  • cluster2Name-02.abc123.com:27017

  • cluster2Name-03.abc123.com:27017

관리 사용자 clusterAdmin 가 각 cluster에 superSecret 비밀번호로 구성되어 있습니다.

자체 관리형 클러스터 의 일반 연결 string 형식은 다음과 같습니다.

mongodb://<user>:<password>@<ip-address>:<port>,<ip-address>:<port>,<ip-address>:<port>

클러스터 의 일반 연결 string 형식은 Atlas 다음과 같습니다.

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

자체 관리형 클러스터에 대해 수집한 연결 정보를 사용하여 cluster0 에 대한 연결 문자열을 만듭니다.

cluster0:
mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020

클러스터 에 대한 연결 은 string Atlas Atlas UI 에서 가져올 수 있습니다. 학습 내용 은 데이터베이스 배포에 연결을 참조하세요.

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

mongosync \
--cluster0 "mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020" \
--cluster1 "mongodb://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net"

Atlas clusters require TLS connections. To use mongosync with Atlas clusters, you add the tls=true option. For example, to connect to the admin database on cluster0 and cluster1:

mongosync \
--cluster0 "mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/admin?tls=true" \
--cluster1 "mongodb://clusterAdmin:superSecret@cluster2Name.abc123.mongodb.net/admin?tls=true"

You can also use mongodb+srv connection strings with mongosync. You do not need to add the tls=true option to a mongodb+srv connection string. For example:

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

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

이 페이지 평가하기