Docs Menu
Docs Home
/ /
Atlas App Services
/

๋ฐฐํฌ์„œ๋ฒ„ ๋กค๋ฐฑ

์ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ

  • ๊ฐœ์š”
  • ์‹œ์ž‘ํ•˜๊ธฐ ์ „์—
  • ์ ˆ์ฐจ

์•ฑ์˜ ๊ตฌ์„ฑ์„ ์ด์ „์— ๋ฐฐํฌ๋œ ๋ฒ„์ „์œผ๋กœ ๋กค๋ฐฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. App Services๋Š” ์•ฑ์˜ ๊ฐ€์žฅ ์ตœ๊ทผ ๋ฐฐํฌ 25๊ฐœ ์ค‘ ํ•˜๋‚˜๋ฅผ ์ž๋™์œผ๋กœ ์žฌ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์ „ ๋ฐฐํฌ์˜ ๊ฒฝ์šฐ ๊ตฌ์„ฑ ํŒŒ์ผ(์˜ˆ: ์†Œ์Šค ์ œ์–ด์—์„œ)์„ ์ˆ˜๋™์œผ๋กœ ๊ฐ€์ ธ์™€ ๋ฐฐํฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์žฌ๋ฐฐํฌ๋Š” ์ด์ „ ๋ฒ„์ „๊ณผ ์ผ์น˜ํ•˜๋„๋ก ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๊ตฌ์„ฑ์„ ๋กค๋ฐฑํ•ฉ๋‹ˆ๋‹ค.

Atlas UI์—์„œ ์•ฑ์„ ๋กค๋ฐฑํ•˜๋ ค๋ฉด ๋‹ค์Œ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

  • ํ”„๋กœ์ ํŠธ ์†Œ์œ ์ž ๊ถŒํ•œ์ด ์žˆ๋Š” MongoDB Atlas ๊ณ„์ •. ๋ฌด๋ฃŒ ๊ณ„์ •์„ ๋“ฑ๋กํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํ•™์Šต ๋ณด๋ ค๋ฉด Atlas ์‹œ์ž‘ํ•˜๊ธฐ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

๊ด€๋ฆฌ์ž API ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์•ฑ์„ ๋กค๋ฐฑ ํ•˜๋ ค๋ฉด ๋‹ค์Œ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

1

์•ฑ์˜ ๋ฐฐํฌ ๊ธฐ๋ก ํŽ˜์ด์ง€์—์„œ ์žฌ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๋ ค๋ฉด ์™ผ์ชฝ ํƒ์ƒ‰ ๋ฉ”๋‰ด์—์„œ Deployment ์„ ํด๋ฆญํ•œ ๋‹ค์Œ History ํƒญ ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

2

๋ฐฐํฌ ๊ธฐ๋ก ๋ชฉ๋ก์—์„œ ๋กค๋ฐฑํ•˜๋ ค๋Š” ๋ฐฐํฌ๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ฐฐํฌ์„œ๋ฒ„์˜ Re-Deploy ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

3

๋ฐฐํฌ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ๋ฐฐํฌ ์„ฑ๊ณต ๋ฐฐ๋„ˆ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ƒˆ ๋ฐฐํฌ๊ฐ€ ๋ฐฐํฌ ๋‚ด์—ญ์— ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

GitHub ๋ฐฐํฌ๋ฅผ ํ™œ์„ฑํ™”ํ•œ ๊ฒฝ์šฐ GitHub ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ์ปค๋ฐ‹ ๋งํฌ๋„ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

์—ฐ๊ฒฐ๋œ Github ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์—์„œ ์ปค๋ฐ‹ ์ž‘์„ฑ์ž๋Š” mongodb-realm ๋ด‡์ž…๋‹ˆ๋‹ค.

Github์˜ ๋ฐฐํฌ์„œ๋ฒ„ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ์Šคํฌ๋ฆฐ์ƒท
1

MongoDB Atlas API ํ‚ค ์Œ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ด€๋ฆฌ์ž ์‚ฌ์šฉ์ž ์ธ์ฆ ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

curl -X POST \
https://services.cloud.mongodb.com/api/admin/v3.0/auth/providers/mongodb-cloud/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"username": "<Public API Key>",
"apiKey": "<Private API Key>"
}'

์ธ์ฆ ์ด ์„ฑ๊ณตํ•˜๋ฉด ์‘๋‹ต ๋ณธ๋ฌธ์— access_token ๊ฐ’์„ ๊ฐ€์ง„ JSON ๊ฐ์ฒด ๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

{
"access_token": "<access_token>",
"refresh_token": "<refresh_token>",
"user_id": "<user_id>",
"device_id": "<device_id>"
}

access_token ์€(๋Š”) App Services Admin API ์— ๋Œ€ํ•œ ์•ก์„ธ์Šค ์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋“  ๊ด€๋ฆฌ์ž API ์š”์ฒญ์— ๋Œ€ํ•ด Authorization ํ—ค๋”์— ๋ฒ ์–ด๋Ÿฌ ํ† ํฐ์œผ๋กœ ํฌํ•จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํŒ

๋‹ค์Œ๋„ ์ฐธ์กฐํ•˜์„ธ์š”.

2

์žฌ๋ฐฐํฌํ•˜๋ ค๋Š” ๋ฐฐํฌ์„œ๋ฒ„ ์˜ _id ์ด(๊ฐ€) ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ์ฐพ์œผ๋ ค๋ฉด ์•ฑ์˜ 25 ๊ฐ€์žฅ ์ตœ๊ทผ ๋ฐฐํฌ ๋ชฉ๋ก์œผ๋กœ ์‘๋‹ตํ•˜๋Š” ๋ฐฐํฌ ๋ชฉ๋ก ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

๋ชฉ๋ก์—์„œ ์žฌ๋ฐฐํฌํ•˜๋ ค๋Š” ๋ฐฐํฌ์„œ๋ฒ„๋ฅผ ์ฐพ์•„ ํ•ด๋‹น ๋ฐฐํฌ์„œ๋ฒ„ ์„œ๋ฒ„์˜ _id ์„(๋ฅผ) ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

curl -X GET \
https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/deployments \
-H 'Authorization: Bearer <access_token>'
[
{
"_id": "638662e881ad88c37dcb7656",
"app_id": "63844243ec3f52ed48923213",
"draft_id": "638662d6cc4b58e348927a7a",
"user_id": "59231005d323af2275135258",
"deployed_at": 1669751529,
"origin": "UI",
"commit": "",
"status": "successful",
"status_error_message": "",
"diff_url": "",
"name": "638662e881ad88c37dcb7656",
"remote_location": "US-VA"
},
{
"_id": "638662b2fd660afffb39df01",
"app_id": "63844243ec3f52ed48923213",
"draft_id": "638662928d19776b743d3b30",
"user_id": "593f1105d383ad2275165258",
"deployed_at": 1669751475,
"origin": "UI",
"commit": "",
"status": "successful",
"status_error_message": "",
"diff_url": "",
"name": "638662b2fd660afffb39df01",
"remote_location": "US-VA"
}
]
3

๋ฐฐํฌ ์„œ๋ฒ„ ์žฌ๋ฐฐํฌ ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์ด์ „ ๋ฐฐํฌ์„œ๋ฒ„ ๋กœ ๋กค๋ฐฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์žฌ๋ฐฐํฌํ•˜๋ ค๋Š” ๋ฐฐํฌ์„œ๋ฒ„ ์˜ _id ์„ deploymentId ๋งค๊ฐœ ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.

curl -X GET \
https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/deployments/{deploymentId}/redeploy \
-H 'Authorization: Bearer <access_token>'

๋Œ์•„๊ฐ€๊ธฐ

์•ฑ ์‚ญ์ œํ•˜๊ธฐ

์ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ