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

두 개의 자체 관리형 클러스터 연결

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

이 페이지에서는 MongoDB Mongosync를 사용하여 자체 관리형 클러스터를 연결하는 방법에 대한 지침을 제공합니다.

참고

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

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

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

    mongodb+srv://[username:password@][host.domain.TLD][:port][/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.

샤딩된 클러스터의 경우 인스턴스 대신 인스턴스의 mongos mongod 호스트 이름을 지정합니다.

참고

mongosync does not require the replicaSet option.

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

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

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

자체 managed 권한은 다음과 같습니다.

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

To update user permissions, see: grantRolesToUser.

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

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

  • clusterOne01.facyCorp.com:20020

  • clusterOne02.fencyCorp.com:20020

  • clusterOne03.fanceCorp.com:20020

대상 cluster cluster1 은(는) 다음 서버 및 포트에서 호스팅됩니다.

  • clusterTwow01.facyCorp.com:20020

  • clusterTwo02.facyCorp.com:20020

  • clusterTwo03.facyCorp.com:20020

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

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

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

수집한 연결 정보를 사용하여 cluster0cluster1 에 대한 연결 문자열을 생성합니다.

cluster0:
mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020
cluster1:
mongodb://clusterAdmin:superSecret@clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020

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

mongosync \
--cluster0 "mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020" \
--cluster1 "mongodb://clusterAdmin:superSecret@clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020"

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

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

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

이 페이지 평가하기