This tutorial shows you how to use the atlas deployments command to create a local Atlas deployment. In this tutorial, we will deploy a single-node replica set on your local computer. You can then manage your deployment, and use MongoDB Search and MongoDB Vector Search.
로컬 Atlas 배포에 지원되는 OS
운영 체제 | 운영 체제 버전 | 아키텍처 | 최소 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 |
사전 요구 사항을 완료하세요.
시작하기 전에 다음 사전 요구 사항을 완료하세요.
중요
종속성 목록의 각 제품에 대한 호환성 정보는 제품의 설치 설명서를 참조하세요.
종속성을 설치합니다.
Homebrew 를 사용하는 경우 터미널에서 다음 명령을 실행 수 있습니다.
brew install mongodb-atlas-cli 다른 운영 체제에 대한 설치 지침은 Atlas CLI 설치 또는 업데이트를 참조하세요.
Docker설치합니다.
Docker 는 MongoDB 이미지를 가져오고 캐싱하기 위해 네트워크 연결이 필요합니다.
For MacOS 또는 Windows 의 경우 Docker Desktop v4.31+.를 설치합니다.
Linux 의 경우 Docker Engine v27.0+를 설치합니다.
Linux RHEL의 경우 Podman v5.0+를 사용할 수도 있습니다.
(선택 사항)mongosh 버전 이상을 2.0 설치합니다.
brew install mongosh 다른 운영 체제에 대한 설치 지침은 mongosh 설치를 참조하세요.
(선택 사항) Compass 버전 1.39.4 이상을 설치합니다.
brew install mongodb-compass 다른 운영 체제에 대한 설치 지침은 Compass 다운로드 및 설치를 참조하세요.
(선택 사항) Visual Studio Code 및 MongoDB for VS Code 확장을 설치합니다.
Atlas 계정을 생성하세요.
기존 Atlas 계정이 아직 없는 atlas setup 경우 터미널에서 를 실행 하거나 새 계정을 만드세요.
로컬 Atlas 배포 만들기
로컬 Atlas 배포를 만들려면 atlas deployments 명령을 사용합니다.
이 명령은 다음과 같은 방법으로 실행할 수 있습니다.
대화형 모드(기본값): 명령은 배포 설정을 묻는 메시지를 표시하고 기본값을 제공합니다.
대화형 모드(사용자 지정): 명령은 배포 설정을 묻는 메시지를 표시하고 사용자 정의 값을 제공할 수 있도록 합니다.
비대화형 모드: 지정된 옵션을 사용하여 명령을 실행 . 이 명령은 추가 값을 제공하라는 메시지를 표시하지 않습니다.
atlas deployments가 지원하는 모든 작업을 학습atlas-deployments을 참조하세요.
다음 탭 중 하나를 클릭하면 원하는 모드에 대한 명령을 확인할 수 있습니다.
로컬 Atlas 데이터베이스를 설정하는 방법을 지정합니다.
예시:
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
옵션과 함께 atlas deployments 명령을 실행합니다.
예시:
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 배포서버 초기화하려면 다음을 수행합니다.
다음 명령을 복사합니다.
atlas deployments setup myLocalRs1 --type local --force --initdb {folder} {folder}자리 표시자를 로컬 컨테이너 내에서 영숫자 순서로 실행.js및.sh파일이 포함된 디렉토리 로 바꿉니다.명령을 실행합니다.
로컬 Atlas 배포 관리
로컬 Atlas 배포를 관리하려면 atlas deployments 명령을 사용합니다. 로컬 및 클라우드 Atlas 배포 모두에 다음 명령을 사용할 수 있습니다. --type local 또는 --type atlas를 사용하여 로컬 또는 클라우드 Atlas 배포에 대해 각각 명령을 실행할 수 있습니다.
배포에 연결합니다.
다음 명령을 실행하여 배포에 연결합니다.
atlas deployments connect 연결할 배포를 지정하고
Enter를 누릅니다.배포에 연결할 방법을 지정하고
Enter키를 누릅니다.연결 문자열 연결 문자열 조회 다음 클라이언트에 연결할 수 있습니다.
Compass 설치한 경우 MongoDB Compass
Visual Studio Code, VisualStudio Code CLI 및 MongoDB for VS Code 확장을 설치한 경우 Visual Studio Code
Atlas 배포 삭제
배포를 삭제하려면 다음 명령을 실행합니다.
atlas deployments delete 삭제할 배포서버를 지정하고
Enter키를 누릅니다.y을(를) 지정하고Enter을(를) 누릅니다. 확인합니다.
로컬 Atlas 배포를 Cloud Atlas 배포로 이동
Docker 및 MongoDB 데이터베이스 도구 사용하여 로컬 Atlas 배포서버를 cloud Atlas 배포서버로 이동할 수 있습니다.
로컬 Atlas 배포 업데이트
Docker 및 MongoDB 데이터베이스 도구 사용하여 로컬 Atlas 배포서버 최신 버전의 이미지로 업데이트 수 있습니다.
Use MongoDB Search with a Local Atlas Deployment
Use the atlas deployments search indexes create command to create an MongoDB Search search index. You can then run MongoDB Search queries. To learn more, see MongoDB Search.
You can run this command with local and cloud Atlas deployments. For detailed steps, see Create a MongoDB Search Index and Run a Query.
Use MongoDB Vector Search with a Local Atlas Deployment
MongoDB Vector Search로 작업하려면 명령을 사용합니다. 자세한 학습 atlas deployments search indexes create 은 벡터 검색을 위한 벡터 임베딩을 인덱스하는 방법을 참조하세요.
You can run this command with local and cloud Atlas deployments. For detailed steps, see Use MongoDB Vector Search with an Atlas Deployment.
중요
MongoDB Vector Search와 함께 Atlas CLI 사용하려면 MongoDB 7.0.5 이상으로 Atlas 배포서버 생성해야 합니다. 이전 MongoDB 버전을 사용하여 로컬 Atlas 배포서버 만든 경우 최신 MongoDB 버전을 자동으로 가져오지 않습니다. 이전 이미지와 배포를 삭제 해야 합니다. 그런 다음 새 Atlas 배포서버 만들어야 합니다.
지원되는 작업
atlas deployments 가 지원하는 모든 작업을 학습 atlas-deployments을 참조하세요.
오류 문제 해결
로컬 Atlas 배포 문제 해결에 학습 보려면 로컬 Atlas 배포서버 문제 Atlas 을 참조하세요.