Docs Menu
Docs Home
/ /
Atlas CLI
/

구성 파일을 사용하여 Atlas 클러스터 만들기

이 페이지의 내용

  • 전제 조건
  • 구성 파일에서 Atlas 클러스터 만들기
  • 기존 클러스터 구성 설정을 파일로 내보내기
  • (선택 사항) 새 클러스터의 구성 파일 편집
  • 구성 파일을 사용하여 새 클러스터 만들기

이 튜토리얼에서는 Atlas CLI 명령을 사용하여 구성 파일에서 새 Atlas 클러스터를 생성하는 방법을 보여 줍니다. 구체적으로 다음과 같은 방법을 보여줍니다.

  1. 기존 Atlas cluster 의 구성 설정을 가져오고 atlas cluster 설명 명령을 사용하여 구성 파일에 설정을 저장합니다.

  2. Atlas cluster 생성 명령을 사용하여 구성 파일에서 cluster를 Atlas 생성합니다.

시작하기 전에 다음이 필요합니다.

이 섹션의 절차에 따라 구성 파일을 직접 수동으로 생성하는 대신 기존 클러스터에서 설정을 내보내 새 클러스터를 쉽게 생성할 수 있습니다.

1

자세한 내용 은 Atlas CLI에서 연결을 참조하세요.

2
atlas clusters describe <cluster-name> --output json > myCluster.json

앞의 명령에서 <cluster-name> 을 복제하려는 기존 클러스터의 이름으로 바꿉니다.

1

예제

다음 예시에서는 vi 편집기를 사용하여 myCluster.json 파일에서 mySandbox 라는 이름의 M10 클러스터에 대한 복제본 세트 설정을 확인합니다.

vi myCluster.json
1{
2 "backupEnabled": true,
3 "biConnector": {
4 "enabled": false,
5 "readPreference": "secondary"
6 },
7 "clusterType": "REPLICASET",
8 "connectionStrings": {
9 "standard": "<connection-string>"
10 },
11 "diskSizeGB": 10,
12 "encryptionAtRestProvider": "NONE",
13 "groupId": "<group-id>",
14 "id": "<64403dd1f2a6b45e71527d5a>",
15 "mongoDBMajorVersion": "6.0",
16 "mongoDBVersion": "6.0.5",
17 "name": "mySandbox",
18 "paused": false,
19 "pitEnabled": true,
20 "stateName": "IDLE",
21 "replicationSpecs": [
22 {
23 "numShards": 1,
24 "id": "64403dbb0a052449df3d04ae",
25 "zoneName": "Zone 1",
26 "regionConfigs": [
27 {
28 "analyticsAutoScaling": {
29 "diskGB": {
30 "enabled": true
31 },
32 "compute": {
33 "enabled": true,
34 "scaleDownEnabled": true,
35 "minInstanceSize": "M10",
36 "maxInstanceSize": "M40"
37 }
38 },
39 "analyticsSpecs": {
40 "diskIOPS": 3000,
41 "ebsVolumeType": "STANDARD",
42 "instanceSize": "M10",
43 "nodeCount": 0
44 },
45 "electableSpecs": {
46 "diskIOPS": 3000,
47 "ebsVolumeType": "STANDARD",
48 "instanceSize": "M10",
49 "nodeCount": 3
50 },
51 "readOnlySpecs": {
52 "diskIOPS": 3000,
53 "ebsVolumeType": "STANDARD",
54 "instanceSize": "M10",
55 "nodeCount": 0
56 },
57 "autoScaling": {
58 "diskGB": {
59 "enabled": true
60 },
61 "compute": {
62 "enabled": true,
63 "scaleDownEnabled": true,
64 "minInstanceSize": "M10",
65 "maxInstanceSize": "M40"
66 }
67 },
68 "priority": 7,
69 "providerName": "AWS",
70 "regionName": "US_EAST_1"
71 }
72 ]
73 }
74 ],
75 "createDate": "2023-04-19T19:15:29Z",
76 "rootCertType": "ISRGROOTX1",
77 "versionReleaseSystem": "LTS",
78 "terminationProtectionEnabled": false
79}
2

선택적 및 필수 설정에 대해 자세히 알아보려면 클러스터 구성 파일을 참조하세요.

3
1

자세한 내용 은 Atlas CLI에서 연결을 참조하세요.

2
atlas clusters create <new-cluster-name> -f myCluster.json

앞의 명령에서 <new-cluster-name> 을 생성하려는 새 클러스터의 이름으로 바꿉니다.

3
atlas clusters watch <new-cluster-name>

앞의 명령에서 <new-cluster-name> 을(를) 새 클러스터의 이름으로 바꿉니다.

이 명령은 클러스터가 IDLE 상태에 도달할 때까지 클러스터의 상태를 주기적으로 확인합니다. cluster가 예상 상태에 도달하면 명령은 'cluster 사용 가능'을 인쇄합니다.

돌아가기

클러스터 생성 및 구성