Docs Menu
Docs Home
/ /
Atlas CLI
/ /

로컬 Atlas 배포 만들기

이 페이지의 내용

  • 로컬 Atlas 배포에 지원되는 OS
  • 사전 요구 사항을 완료하세요.
  • 로컬 Atlas 배포 만들기
  • 로컬 Atlas 배포 관리
  • 로컬 Atlas 배포를 Cloud Atlas 배포로 이동
  • 로컬 Atlas 배포 업데이트
  • 로컬 Atlas 배포와 함께 Atlas Search 사용
  • 로컬 Atlas 배포와 함께 Atlas Vector Search 사용
  • 지원되는 작업
  • 오류 문제 해결

이 튜토리얼에서는 atlas deployments 명령을 사용하여 로컬 Atlas 배포를 만드는 방법을 보여줍니다. 이 튜토리얼에서는 로컬 컴퓨터에 단일 노드 복제본 세트를 배포합니다. 그런 다음 배포를 managed하고 Atlas Search 및 Atlas Vector Search를 사용할 수 있습니다.

운영 체제
운영 체제 버전
아키텍처
최소 CPU 코어
최소 여유 RAM (GB)

macOS

13.2 이상

x86-64, ARM

2

2

Red Hat Enterprise Linux / CentOS

8, 9

x86-64, ARM

2

2

Ubuntu

22.04, 24.04

x86-64, ARM

2

2

Debian

11, 12

x86-64, ARM

2

2

Amazon Linux

2023

x86-64, ARM

2

2

Windows

10, 11

x86

2

2

시작하기 전에 다음 사전 요구 사항을 완료하세요.

중요

종속성 목록의 각 제품에 대한 호환성 정보는 제품의 설치 설명서를 참조하세요.

1
  1. Atlas CLI 를 설치합니다.

    Homebrew 를 사용하는 경우 터미널에서 다음 명령을 실행 수 있습니다.

    brew install mongodb-atlas-cli

    다른 운영 체제에 대한 설치 지침은 Atlas CLI 설치 또는 업데이트를 참조하세요.

  2. Docker설치

    Docker 는 MongoDB 이미지를 가져오고 캐싱하기 위해 네트워크 연결이 필요합니다.

  3. (선택 사항)mongosh 버전 이상을 2.0 설치합니다.

    brew install mongosh

    다른 운영 체제에 대한 설치 지침은 mongosh 설치를 참조하세요.

  4. (선택 사항) Compass 버전 1.39.4 이상을 설치합니다.

    brew install mongodb-compass

    다른 운영 체제에 대한 설치 지침은 Compass 다운로드 및 설치를 참조하세요.

2

기존 Atlas 계정이 아직 없는 atlas setup 경우 터미널에서 를 실행 하거나 새 계정을 만드세요.

로컬 Atlas 배포를 만들려면 atlas deployments 명령을 사용합니다.

중요

로컬 머신에서 15.2 Apple Silicon M 칩이 장착된 MacOS Sequoia4 을 실행하는 경우, 오류를 방지하려면 이 절차 대신 Docker 사용하여 로컬 Atlas 배포서버 만드는 절차를 container configuration failed 따르세요.

이 명령은 다음과 같은 방법으로 실행할 수 있습니다.

  • 대화형 모드(기본값): 명령은 배포 설정을 묻는 메시지를 표시하고 기본값을 제공합니다.

  • 대화형 모드(사용자 지정): 명령은 배포 설정을 묻는 메시지를 표시하고 사용자 정의 값을 제공할 수 있도록 합니다.

  • 비대화형 모드: 지정된 옵션을 사용하여 명령을 실행합니다. 이 명령은 추가 값을 제공하라는 메시지를 표시하지 않습니다. atlas deployments가 지원하는 모든 조치에 대해 알아보려면 Atlas 배포를 참조하세요.

다음 탭 중 하나를 클릭하면 원하는 모드에 대한 명령을 확인할 수 있습니다.

1
atlas deployments setup

자체 데이터 및 인덱스를 사용하여 로컬 Atlas 배포서버 서버를 초기화하려면 다음을 수행합니다.

  1. 다음 명령을 복사합니다.

    atlas deployments setup --initdb {folder}
  2. {folder} 자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행 .js.sh 파일이 포함된 디렉토리 로 바꿉니다.

  3. 명령을 실행합니다.

2

예시:

local - Local Database 을(를) 지정하고 Enter 을(를) 누릅니다.

? What would you like to deploy? [Use arrows to move, type to filter, ? for more help]
> local - Local Database
atlas - Atlas Database
[Default Settings]
Deployment Name local50
MongoDB Version 7.0
Port 27017
3

예시:

default - With default settings를 지정하고 Enter를 누릅니다.

? How do you want to setup your local MongoDB database? [Use arrows to move, type to filter]
> default - With default settings
custom - With custom settings
cancel - Cancel set up
Creating your deployment local50 [this might take several minutes]
1/4: Downloading and completing configuration...
2/4: Starting your local environment...
3/4: Downloading MongoDB binaries to your local environment...
4/4: Creating your deployment local50...
Deployment created!
Connection string: mongodb://localhost:27017/?directConnection=true
1
atlas deployments setup

자체 데이터 및 인덱스를 사용하여 로컬 Atlas 배포서버 서버를 초기화하려면 다음을 수행합니다.

  1. 다음 명령을 복사합니다.

    atlas deployments setup --initdb {folder}
  2. {folder} 자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행 .js.sh 파일이 포함된 디렉토리 로 바꿉니다.

  3. 명령을 실행합니다.

2

local - Local Database를 지정하고 Enter를 누릅니다.

예시:

? What would you like to deploy? [Use arrows to move, type to filter, ? for more help]
> local - Local Database
atlas - Atlas Database
[Default Settings]
Deployment Name local50
MongoDB Version 7.0
Port 27017
3

예시:

custom - With custom settings를 지정하고 Enter를 누릅니다.

? How do you want to setup your local MongoDB database? [Use arrows to move, type to filter]
default - With default settings
> custom - With custom settings
cancel - Cancel set up
4

예시:

myLocalRs를 지정하고 Enter를 누릅니다.

? Deployment Name [This can't be changed later] (local3612) myLocalRs
5

예시:

7.0를 지정하고 Enter를 누릅니다.

? MongoDB Version [Use arrows to move, type to filter]
> 7.0
6.0
6

예시:

37018를 지정하고 Enter를 누릅니다.

? Specify a port (49469) 37018
Creating your deployment myLocalRs
1/2: Starting your local environment...
2/2: Creating your deployment myLocalRs...
Deployment created!
Connection string: mongodb://localhost:37018/?directConnection=true
1

예시:

atlas deployments setup myLocalRs1 --type local --force
[Default Settings]
Deployment Name myLocalRs1
MongoDB Version 7.0
Port 49684
Creating your deployment myLocalRs1
1/2: Starting your local environment...
2/2: Creating your deployment myLocalRs1...
Deployment created!
Connection string: mongodb://localhost:49684/?directConnection=true
connection skipped

자체 데이터 및 인덱스를 사용하여 로컬 Atlas 배포서버 서버를 초기화하려면 다음을 수행합니다.

  1. 다음 명령을 복사합니다.

    atlas deployments setup myLocalRs1 --type local --force --initdb {folder}
  2. {folder} 자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행 .js.sh 파일이 포함된 디렉토리 로 바꿉니다.

  3. 명령을 실행합니다.

로컬 Atlas 배포를 관리하려면 atlas deployments 명령을 사용합니다. 로컬 및 클라우드 Atlas 배포 모두에 다음 명령을 사용할 수 있습니다. --type local 또는 --type atlas를 사용하여 로컬 또는 클라우드 Atlas 배포에 대해 각각 명령을 실행할 수 있습니다.

1

예시:

atlas deployments list
NAME TYPE MDB VER STATE
local50 LOCAL 7.0.1 IDLE
local62 LOCAL 7.0.1 IDLE
myLocalRs LOCAL 7.0.1 IDLE
myLocalRs1 LOCAL 7.0.1 IDLE
2
  1. 다음 명령을 실행하여 샘플 데이터를 다운로드합니다.

    curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archive
  2. 다음 명령을 복사하여 터미널에 붙여넣고 {port-number}를 배포용 포트로 바꿉니다.

    mongorestore --archive=sampledata.archive --port={port-number}
3
  1. 다음 명령을 실행하여 배포에 연결합니다.

    atlas deployments connect
  2. 연결할 배포를 지정하고 Enter를 누릅니다.

  3. 배포에 연결할 방법을 지정하고 Enter 키를 누릅니다.

4
  1. 배포서버 를 일시 중지하려면 다음 명령을 실행합니다.

    atlas deployments pause
  2. 일시 중지할 배포를 지정하고 Enter 키를 누릅니다.

5
  1. 다음 명령을 실행하여 배포를 시작합니다.

    atlas deployments start
  2. 시작할 배포를 지정하고 Enter 키를 누릅니다.

6
  1. 배포에 대한 로그를 반환하려면 다음 명령을 실행합니다.

    atlas deployments logs
  2. 로그를 반환할 배포를 지정하고 Enter 키를 누릅니다.

7
  1. 배포를 삭제하려면 다음 명령을 실행합니다.

    atlas deployments delete
  2. 삭제할 배포서버를 지정하고 Enter 키를 누릅니다.

  3. y 을(를) 지정하고 Enter 을(를) 누릅니다. 확인합니다.

DockerMongoDB 데이터베이스 도구 를 사용하여 로컬 Atlas 배포서버 를 cloud Atlas 배포서버 로 이동할 수 있습니다.

1
atlas deployments setup --type atlas
2
atlas deployments setup --type local

자체 데이터 및 인덱스를 사용하여 로컬 Atlas 배포서버 서버를 초기화하려면 다음을 수행합니다.

  1. 다음 명령을 복사합니다.

    atlas deployments setup --type local --initdb {folder}
  2. {folder} 자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행 .js.sh 파일이 포함된 디렉토리 로 바꿉니다.

  3. 명령을 실행합니다.

3
  1. 다음 명령을 복사합니다.

    docker exec -u root -it {local_deployment_name} sh -c "mkdir -p /data/dump && chown -R mongod:mongod /data/dump && mongodump --archive=/data/dump/dump.archive"
  2. {local-deployment-name} 자리 표시자를 로컬 Atlas 배포서버 서버의 이름으로 바꿉니다.

  3. 명령을 실행합니다.

4
  1. 다음 명령을 복사합니다.

    docker cp <local deployment name>:/data/dump/dump.archive .
  2. {local-deployment-name} 자리 표시자를 로컬 Atlas 배포서버 서버의 이름으로 바꿉니다.

  3. 명령을 실행합니다.

5
atlas deployments connect --type atlas --connectWith connectionString
6
  1. 다음 명령을 복사합니다.

    mongorestore --uri={connection-string} --archive=./dump.archive
  2. {connection-string} 자리 표시자를 연결 문자열 로 바꿉니다.

  3. 명령을 실행합니다.

7
atlas deployments delete --type local

DockerMongoDB 데이터베이스 도구 를 사용하여 로컬 Atlas 배포서버 를 최신 버전의 이미지로 업데이트 할 수 있습니다.

1
atlas deployments setup --type local

자체 데이터 및 인덱스를 사용하여 로컬 Atlas 배포서버 서버를 초기화하려면 다음을 수행합니다.

  1. 다음 명령을 복사합니다.

    atlas deployments setup --type local --initdb {folder}
  2. {folder} 자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행 .js.sh 파일이 포함된 디렉토리 로 바꿉니다.

  3. 명령을 실행합니다.

2
  1. 다음 명령을 복사합니다.

    docker exec -u root -it {old-local-deployment-name} sh -c "mkdir -p /data/dump && chown -R mongod:mongod /data/dump && mongodump --archive=/data/dump/dump.archive"
  2. {old-local-deployment-name} 자리 표시자를 이전 로컬 Atlas 배포서버 서버의 이름으로 바꿉니다.

  3. 명령을 실행합니다.

3
  1. 다음 명령을 복사합니다.

    docker cp {old-local-deployment-name}:/data/dump/dump.archive .
  2. {old-local-deployment-name} 자리 표시자를 이전 로컬 Atlas 배포서버 서버의 이름으로 바꿉니다.

  3. 명령을 실행합니다.

4
atlas deployments connect --type local --connectWith connectionString
5
  1. 다음 명령을 복사합니다.

    mongorestore --uri={connection-string} --archive=./dump.archive
  2. {connection-string} 자리 표시자를 연결 고리로 바꿉니다.

  3. 명령을 실행합니다.

6
atlas deployments delete --type local

atlas deployments search indexes create 명령을 사용하여 Atlas Search Atlas Search 인덱스를 생성합니다. 그런 다음 Atlas Search 쿼리를 실행할 수 있습니다. 자세히 알아보려면 Atlas Search를 참조하세요.

로컬 및 클라우드 Atlas 배포서버에서 이 명령을 실행할 수 있습니다. 자세한 단계는 Atlas Search 인덱스 생성 및 쿼리 실행을 참조하세요.

atlas deployments search indexes create 명령을 사용하여 Atlas Vector Search로 작업하세요. 자세한 내용 은 Vector Atlas Search를 위한 벡터 임베딩을 인덱스하는 방법을 참조하세요.

이 명령은 로컬 및 cloud Atlas 배포서버에서 실행 수 있습니다. 자세한 단계 는 Atlas 배포에 Atlas Vector Search 사용을 참조하세요.

중요

Atlas CLI를 Atlas Vector Search와 함께 사용하려면 MongoDB 7.0.5 이상을 사용하여 Atlas 배포를 만들어야 합니다. 이전 MongoDB 버전으로 로컬 Atlas 배포를 만든 경우, 최신 MongoDB 버전이 자동으로 제공되지 않습니다. 이전 이미지와 배포를 삭제해야 합니다. 그런 다음 새 Atlas 배포를 생성해야 합니다.

atlas deployments가 지원하는 모든 조치에 대해 알아보려면 Atlas 배포를 참조하세요.

로컬 Atlas 배포 문제 해결에 학습 보려면 로컬 Atlas 배포서버 문제 Atlas 을 참조하세요.

돌아가기

로컬 및 클라우드 배포