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

MongoDB Ops Manager 시작하기

MongoDB CLI는 MongoDB Ops Manager 프로젝트 및 클러스터를 관리하기 위한 명령줄 인터페이스를 제공합니다.

이 튜토리얼에서는 다음을 수행하는 방법을 보여줍니다.

  • Ops Manager 프로젝트에 cluster 생성

  • 새 cluster에 대한 세부 정보 조회

이 튜토리얼에 언급된 명령에 대한 참조 페이지는 MongoDB CLI 명령에서 사용할 수 있습니다.

시작하기 전에 다음 작업을 완료하세요.

Ops Manager에서 cluster를 생성하려면 mongocli Ops Manager cluster create 명령을 사용합니다.

다음 명령어는 다음 설정을 사용하여 샘플 cluster를 생성합니다.

  • 클러스터 이름: getStarted

  • MongoDB Server 버전: 5.0.0

  • 기능 호환성 버전: 5.0

  • 복제본 세트 멤버: 3

  • 멤버 호스트 이름: host1, host2, host3

    참고

    이 튜토리얼에서는 호스트 이름 host1, host2 및 host3 를 사용합니다. 이 호스트 이름을 유효한 MongoDB Server 호스트 이름으로 바꿉니다.

  • 각 mongod 인스턴스에 대한 데이터 디렉토리: /data/cluster/rs1, /data/cluster/rs2, /data/cluster/rs3

  • 각 mongod 인스턴스에 대한 로그 파일 경로: /data/cluster/rs1/mongodb.log, /data/cluster/rs2/mongodb.log, /data/cluster/rs3/mongodb.log

  • 각 mongod 프로세스에 대한 포트: 29010, 29020, 29030

  • 각 멤버의 투표 우선 순위: 1

  • 각 멤버의 투표 수: 1

1

구성 파일 속성에 대해 자세히 알아보려면 cluster 구성 파일을 참조하세요.

{ "name": "getStarted", "version": "5.0.0", "featureCompatibilityVersion": "5.0", "processes": [ { "hostname": "host1", "dbPath": "/data/cluster/rs1", "logPath": "/data/cluster/rs1/mongodb.log", "priority": 1, "votes": 1, "port": 29010 }, { "hostname": "host2", "dbPath": "/data/cluster/rs2", "logPath": "/data/cluster/rs2/mongodb.log", "priority": 1, "votes": 1, "port": 29020 }, { "hostname": "host3", "dbPath": "/data/cluster/rs3", "logPath": "/data/cluster/rs3/mongodb.log", "priority": 1, "votes": 1, "port": 29030 } ]}
2
mongocli ops-manager cluster create --file getStartedCluster.json

mongocli Ops Manager cluster describe 명령을 사용하여 cluster 세부 정보를 검색하면 cluster가 성공적으로 생성되었는지 확인할 수 있습니다.

mongocli ops-manager cluster describe getStarted

명령 출력은 다음과 유사해야 합니다.

{ "mongoURI": "mongodb://host1:29010,host2:29020,host3:29030", "name": "getStarted", "processes": [ { "buildIndexes": true, "db_path": "/data/cluster/rs1", "featureCompatibilityVersion": "5.0", "hostname": "host1", "log_path": "/data/cluster/rs1/mongodb.log", "name": "getStartedCluster", "port": 29010, "priority": 1, "process_type": "mongod", "slave_delay": 0, "version": "5.0.0", "votes": 1, "arbiter_only": false, "disabled": false, "hidden": false }, { "buildIndexes": true, "db_path": "/data/cluster/rs2", "featureCompatibilityVersion": "5.0", "hostname": "host2", "log_path": "/data/cluster/rs2/mongodb.log", "name": "getStartedCluster", "port": 29020, "priority": 1, "process_type": "mongod", "slave_delay": 0, "version": "5.0.0", "votes": 1, "arbiter_only": false, "disabled": false, "hidden": false }, { "buildIndexes": true, "db_path": "/data/cluster/rs3", "featureCompatibilityVersion": "5.0", "hostname": "host3", "log_path": "/data/cluster/rs3/mongodb.log", "name": "getStartedCluster", "port": 29030, "priority": 1, "process_type": "mongod", "slave_delay": 0, "version": "5.0.0", "votes": 1, "arbiter_only": false, "disabled": false, "hidden": false } ]}

mongocli Ops Manager 자동화 감시 명령을 실행하여 cluster를 사용할 준비가 되었는지 확인합니다. 다음 명령은 기본 프로필을 사용하여 Ops Manager 프로젝트에 액세스합니다.

mongocli om automation watch

축하합니다! 데이터를 호스팅하다 할 클러스터 가 성공적으로 생성되었습니다. 또는 애플리케이션 의 연결 을 사용하여 클러스터 에 string mongosh 연결하거나 UI 에 로그인하여 클러스터 를 볼 수 있습니다.