Docs Menu
Docs Home
/
MongoDB Enterprise Kubernetes ์—ฐ์‚ฐ์ž
/ / /

๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ์•„ํ‚คํ…์ฒ˜ ๋‹ค์ด์–ด๊ทธ๋žจ: MongoDB Ops Manager ๋ฐ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค

MongoDB Ops Manager ๋‹ค์Œ ๋‹ค์ด์–ด๊ทธ๋žจ์€ ์—ฌ๋Ÿฌ Kubernetes Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— ๋ฐฐํฌ๋œ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค, ๋ฐฑ์—… ๋””๋จผ ๋ฐ ํ•ด๋‹น ์˜๊ตฌ ๋ณผ๋ฅจ ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— MongoDB Ops Manager, ํ•ด๋‹น UI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค, ๋ฐฑ์—… ๋ฐ๋ชฌ์„ ๊ฐ„๋žตํ•˜๊ฒŒ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์„ ๋ณด์—ฌ์ฃผ๋Š” ๋‹ค์ด์–ด๊ทธ๋žจ์ž…๋‹ˆ๋‹ค. ์ด ๋‹ค์ด์–ด๊ทธ๋žจ์€ ๊ตฌ์„ฑ ์š”์†Œ ๊ฐ„์˜ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ๋„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
ํด๋ฆญํ•˜์—ฌ ํ™•๋Œ€

์ด ๋‹ค์ด์–ด๊ทธ๋žจ์—์„œ๋Š” ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  1. Member Cluster 0 ์€(๋Š”) Kubernetes Operator๋ฅผ ์„ค์น˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์— '์šด์˜์ž ํด๋Ÿฌ์Šคํ„ฐ'์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ "๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ"์ด๋ฉฐ ๋ชจ๋“  ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ์‚ฌ์šฉ์ž ์ง€์ • ๋ฆฌ์†Œ์Šค๋ฅผ ํ˜ธ์ŠคํŒ…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  2. ์€ Member Cluster 0 kubeconfig ํŒŒ์ผ์„ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ,Kubernetes ๊ตฌ์„ฑ ์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ, ์‚ฌ์šฉ์ž ๋ฐ ์ปจํ…์ŠคํŠธ์— ๋Œ€ํ•œ kubectl mongodb ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด Kubernetes Operator๋ฅผ ๊ตฌ์„ฑํ•˜๋ฉด ๋‹ค์Œ ๋ฆฌ์†Œ์Šค ๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

    • Kubernetes Operator๊ฐ€ ๊ด€๋ฆฌํ•  ๋ชจ๋“  Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•œ ์ž๊ฒฉ ์ฆ๋ช…์ด ํฌํ•จ๋œ mongodb-enterprise-operator-multi-cluster-kubeconfig ์‹œํฌ๋ฆฟ. ์—ฐ์‚ฐ์ž ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ๋กœ ์‚ฌ์šฉํ•˜๋ ค๋Š” ๊ฒฝ์šฐ, ์ด ์‹œํฌ๋ฆฟ์—๋Š” Kubernetes ์—ฐ์‚ฐ์ž๋ฅผ ์„ค์น˜ํ•œ ํด๋Ÿฌ์Šคํ„ฐ์™€ ๋™์ผํ•œ ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•œ ์ž๊ฒฉ ์ฆ๋ช…์ด ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    Kubernetes Operator๊ฐ€ ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ๋ชจ๋“œ ์—์„œ ์‹คํ–‰๋˜๋Š” ๊ฒฝ์šฐ, ConfigMaps ๋ฐ ๊ด€๋ฆฌ ํ•˜๋ ค๋Š” ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•œ ์‹œํฌ๋ฆฟ๊ณผ ๊ฐ™์ด ํ•„์š”ํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋ฆฌ์†Œ์Šค๋Š” Kubernetes Operator์™€ ๋™์ผํ•œ ๋„ค์ž„์ŠคํŽ˜์ด์Šค ์— ์†ํ•ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋Š” ์ด๋Ÿฌํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ MongoDB Ops Manager ์—ฌ๋Ÿฌ Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋ฐฐํฌ ํ•ฉ๋‹ˆ๋‹ค.

  3. ๋˜ํ•œ Kubernetes Operator๋Š” ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฐํฌ์„œ๋ฒ„ ์— ๋Œ€ํ•ด ๋ช‡ ๊ฐ€์ง€ ์ถ”๊ฐ€ ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ๋ฐฐํฌ์„œ๋ฒ„ ์ƒํƒœ ConfigMap์„ ์ƒ์„ฑํ•˜๊ณ  ์œ ์ง€ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. Member Cluster 0 ๋Š” ๋‹ค์Œ ConfigMap์„ ํฌํ•จํ•˜์—ฌ ์ด ๊ตฌ์„ฑ์„ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

    • <om_resource_name>-cluster-mapping ConfigMap์—๋Š” spec.clusterSpecList ์— ๋‚˜์—ด๋œ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์ด๋ฆ„๊ณผ ์ด ๋ฌธ์„œ์—์„œ cluster_index ๋กœ ์ฐธ์กฐ๋œ ํด๋Ÿฌ์Šคํ„ฐ ์ธ๋ฑ์Šค(์˜ˆ: Cluster 0 ๋˜๋Š” Cluster 1)์— ๋Œ€ํ•œ ๋งคํ•‘์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. Kubernetes Operator๋Š” ์ด๋Ÿฌํ•œ ์ธ๋ฑ์Šค๋ฅผ ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์ด๋ฆ„์— ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.

    • <om_resource_name>-db-cluster-mapping ConfigMap์—๋Š” spec.applicationDatabase.clusterSpecList ์— ๋‚˜์—ด๋œ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์ด๋ฆ„๊ณผ ํด๋Ÿฌ์Šคํ„ฐ ์ธ๋ฑ์Šค ๊ฐ„์˜ ๋งคํ•‘์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

    • <om_resource_name>-db-member-spec ConfigMap์—๋Š” ๊ฐ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์— ๋Œ€ํ•ด ๊ตฌ์„ฑ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ณต์ œ๋ณธ ์ˆ˜๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์ •๋ณด๊ฐ€ ์žˆ์œผ๋ฉด Kubernetes Operator๊ฐ€ ์ „์ฒด ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ๋ฅผ ์žƒ์€ ํ›„ ์žฌํ•ด ๋ณต๊ตฌ์˜ ์ผ๋ถ€๋กœ ๋ณต์ œ๋ณธ ์„ธํŠธ ๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ํ™•์žฅํ•˜๋‹ค ํ•˜๊ฑฐ๋‚˜ ์žฌ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  4. MongoDBOpsManager ๋ฆฌ์†Œ์Šค์˜ ๊ตฌ์„ฑ์€ ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ MongoDB Ops Manager ๋ฐฐํฌ์„œ๋ฒ„ ๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ์ž๊ฐ€ ์ƒ์„ฑํ•˜๋Š” ํŒŒ์ผ ์ž…๋‹ˆ๋‹ค. Kubernetes Operator๋Š” ์ด ํŒŒ์ผ ์„ ์‚ฌ์šฉํ•˜์—ฌ MongoDB Ops Manager ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋ฐฐํฌ ํ•ฉ๋‹ˆ๋‹ค.

    ๋‹ค์Œ ์˜ˆ์ œ๋Š” ์ด ๋‹ค์ด์–ด๊ทธ๋žจ์— ์„ค๋ช…๋œ MongoDB Ops Manager ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋ฐฐํฌํ•˜๋Š” Kubernetes Operator๋กœ ์ด์–ด์ง€๋Š” ๊ตฌ์„ฑ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ์ด ์˜ˆ์—์„œ๋Š” ์ด ๋‹ค์ด์–ด๊ทธ๋žจ๊ณผ ๊ด€๋ จ์ด ์—†๋Š” ์ผ๋ถ€ ์„ค์ •(์˜ˆ: TLS ๊ตฌ์„ฑ)์„ ์ƒ๋žตํ•ฉ๋‹ˆ๋‹ค.

    1apiVersion: mongodb.com/v1
    2kind: MongoDBOpsManager
    3metadata:
    4 name: om
    5 namespace: om-ns
    6spec:
    7 replicas: 1 # You can set this value and use it as a global or default
    8 # setting for all clusters. The spec.clusterSpecList.members
    9 # setting overrides this setting.
    10 topology: MultiCluster
    11 version: 6.0.22
    12 adminCredentials: om-admin-secret
    13 clusterSpecList:
    14 - clusterName: "Member Cluster 1" # Ops Manager settings for "Member Cluster 1"
    15 members: 2
    16 backup: # Backup settings for "Member Cluster 1"
    17 members: 2 # Overrides spec.backup.members
    18 - clusterName: "Member Cluster 2" # Ops Manager settings for "Member Cluster 2"
    19 members: 1
    20 backup: # Backup settings for "Member Cluster 2"
    21 members: 2 # Overrides spec.backup.members
    22 applicationDatabase: # Global {+appdb+} settings
    23 topology: MultiCluster
    24 version: 6.0.5-ent
    25 members: 3 # In multi-cluster mode, the Operator ignores this field.
    26 # The Operator sets the number of members for the Application
    27 # Database in spec.applicationDatabase.clusterSpecList.members.
    28 clusterSpecList:
    29 - clusterName: "Member Cluster 1"
    30 members: 3
    31 - clusterName: "Member Cluster 2"
    32 members: 2
    33 backup: # Global settings for the Backup Daemon
    34 enabled: true
    35 members: 1 # Set this value and use it as a global or default setting.
    36 # To override this value, set the value for
    37 # spec.clusterSpecList.backup.members.
    38 # The Backup Daemon's configuration for each cluster isn't
    39 # stored here. Use the Ops Manager's spec.clusterSpecList.backup to
    40 # specify the Backup Daemon configuration for each member cluster.
  5. Kubernetes Operator๋Š” ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์ฐธ์กฐํ•˜์—ฌ MongoDB Ops Manager ์ธ์Šคํ„ด์Šค์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

    • ๋ฆฌ์†Œ์Šค ์— ๋Œ€ํ•ด ์ƒ์„ฑํ•˜๋Š” ์„œ๋น„์Šค์˜ ๊ธฐ๋ณธ๊ฐ’ FQDN MongoDB Ops Manager <om_resource_name>-svc.<namespace>.svc.cluster.local๋˜๋Š”

    • spec.opsManagerURL ์— ์ง€์ •ํ•˜๋Š” URL ์ž…๋‹ˆ๋‹ค. Kubernetes Operator๋ฅผ ์„ค์น˜ํ•œ ํด๋Ÿฌ์Šคํ„ฐ ๊ฐ€ ์„œ๋น„์Šค ๋ฉ”์‹œ์— ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ์™€ ๊ฐ™์€ ์ผ๋ถ€ ๋ฐฐํฌ์—์„œ๋Š” ๊ธฐ๋ณธ๊ฐ’ ์„œ๋น„์Šค FQDN ์— ์—ฐ๊ฒฐํ•˜์ง€ ๋ชปํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ Kubernetes Operator๋Š” MongoDBOpsManager ๋ฆฌ์†Œ์Šค ์ƒํƒœ๋ฅผ ์—ฐ๊ฒฐ ์˜ค๋ฅ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” Failed ๋กœ ๋ณด๊ณ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ฒฝ์šฐ๋ฅผ URL ๊ณ ๋ คํ•˜๋ ค๋ฉด MongoDB Ops Manager ์—์„œ spec.opsManagerURL ์˜ ์„ ์ œ๊ณตํ•˜์„ธ์š”. ์ด URL ์€ ์™ธ๋ถ€์— ๋…ธ์ถœ๋œ MongoDB Ops Manager ์ธ์Šคํ„ด์Šค ์˜ ํ˜ธ์ŠคํŠธ ์ด๋ฆ„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•™์Šต ๋‚ด์šฉ์€ ๋„คํŠธ์›Œํ‚น ๊ฐœ์š”๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

  6. ๋‘ ๊ฐœ์˜ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ๋Š” MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„ ํ˜ธ์ŠคํŒ…ํ•˜๋‹ค ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์—์„œ Kubernetes Operator๋Š” <om_resource_name>-<cluster_index> ์ด๋ผ๋Š” StatefulSet๋ฅผ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.

    • StatefulSet๋Š” Member Cluster 1 ์— MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ธ์Šคํ„ด์Šค 2๊ฐœ๋ฅผ ๋ฐฐํฌํ•˜๊ณ  Member Cluster 2์— ์ธ์Šคํ„ด์Šค 1๊ฐœ๋ฅผ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.

    • spec.clusterSpecList.members ์˜ ์ธ์Šคํ„ด์Šค ์ˆ˜๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ํด๋Ÿฌ์Šคํ„ฐ ๊ฐ€ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ธ์Šคํ„ด์Šค๋ฅผ ๋ฐฐํฌ ํ•˜์ง€ ์•Š๋„๋ก ์ธ์Šคํ„ด์Šค ์ˆ˜๋ฅผ 0์œผ๋กœ ์„ค์ •ํ•˜๋‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์˜ˆ์‹œ ๋ฐฑ์—… ๋””๋จผ ์ธ์Šคํ„ด์Šค๋งŒ ํ˜ธ์ŠคํŒ…ํ•˜๋Š” ๋ฐ ์ด ํด๋Ÿฌ์Šคํ„ฐ ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋Š” ๊ฒฝ์šฐ์— ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

      spec.clusterSpecList ์—์„œ ํด๋Ÿฌ์Šคํ„ฐ ๋ฅผ ์ œ๊ฑฐ ํ•˜๋Š” ๊ฒฝ์šฐ, ์ด๋Š” spec.clusterSpecList.members ๋ฐ spec.clusterSpecList[*].backup.members ์— 0๊ฐœ์˜ ๋ฉค๋ฒ„๋ฅผ ์ง€์ •ํ•˜๋Š” ๊ฒƒ๊ณผ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.

    • ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์˜ ๊ฐ StatefulSet์— ๋Œ€ํ•ด Kubernetes Operator๋Š” ์„œ๋น„์Šค๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๋ผ๋Š” ์ด๋ฆ„์˜ ์œ ํ˜•์œผ๋กœ,ClusterIP <om_resource_name>-svcํด๋Ÿฌ์Šคํ„ฐ์˜ ์—”๋“œํฌ์ธํŠธ ๋ชฉ๋ก์— ์žˆ๋Š” ๋ชจ๋“  ํŒŒ๋“œ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ์ด ์„œ๋น„์Šค์˜ FQDN์ธ <om_resource_name>-svc.<namespace>.svc.cluster.local์€ Kubernetes Operator๊ฐ€ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋ฐฐํฌ๋œ ์—”๋“œํฌ์ธํŠธ์— ์•ก์„ธ์Šค ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๋ณธ๊ฐ’ ํ˜ธ์ŠคํŠธ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

    • spec.externalConnectivity ๋ฅผ ์ง€์ •ํ•˜๋Š” ๊ฒฝ์šฐ, Kubernetes Operator๋Š” ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์— ๋Œ€ํ•ด <om_resource_name>-svc-ext ๋ผ๋Š” ์™ธ๋ถ€ Kubernetes LoadBalancer์œ ํ˜• ์„œ๋น„์Šค๋„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์—์„œ spec.clusterSpecList.externalConnectivity ์„(๋ฅผ) ์‚ฌ์šฉํ•˜์—ฌ ์ด ์™ธ๋ถ€ ์„œ๋น„์Šค์— ๋Œ€ํ•œ ์ž์ฒด ๊ตฌ์„ฑ์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ์˜ˆ์‹œ ์„œ๋น„์Šค ์œ ํ˜•์„ ๋ณ€๊ฒฝํ•˜๊ฑฐ๋‚˜ ์ฃผ์„์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  7. ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค. Kubernetes Operator๋Š” ๋‘ ํด๋Ÿฌ์Šคํ„ฐ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.

    • Member Cluster 1 ์—๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋Œ€ํ•œ mongod ํ”„๋กœ์„ธ์Šค 3๊ฐœ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ๊ณ , Member Cluster 2 ์—๋Š” mongod ํ”„๋กœ์„ธ์Šค 2๊ฐœ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

    • spec.applicationDatabase ์„ค์ •์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๊ตฌ์„ฑ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์—์„œ Kubernetes Operator ๋Š” spec.applicationDatabase.clusterSpecList.members ์— ์ •์˜๋œ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ <om_resource_name>-db-<cluster_index> ์ด๋ผ๋Š” StatefulSet ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ๋ชจ๋“œ ์—์„œ Kubernetes Operator๋Š” spec.applicationDatabase.members ํ•„๋“œ ์— ์„ค์ •ํ•˜๋‹ค ํ•œ ๊ฐ’์„ ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋Š” ๋ชจ๋“  ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ์— ๋ฐฐํฌ๋œ mongod ํ”„๋กœ์„ธ์Šค๋กœ ๊ตฌ์„ฑ๋œ ํ•˜๋‚˜์˜ ๋ณต์ œ๋ณธ ์„ธํŠธ ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ด๋ผ๋Š” <statefulset_name>-<pod_index> ์ด๋ฆ„์˜ MongoDB ํ”„๋กœ์„ธ์Šค <om_resource_name>-db-<cluster_index>-<pod_index> ๋ฅผ ํ˜ธ์ŠคํŒ…ํ•˜๋Š” ClusterIP์˜ ๊ฐ ํŒŒ๋“œ์— ๋Œ€ํ•ด mongod Kubernetes Operator๋Š” ํ•ด๋‹น FQDN ๋กœ ๊ฐœ๋ณ„ ํ”„๋กœ์„ธ์Šค์— ์•ก์„ธ์Šคํ•˜๊ธฐ ์œ„ํ•œ Kubernetes ์œ ํ˜• ์„œ๋น„์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. <om_resource_name>-db-<cluster_index>-<pod_index>-svc ๋ณต์ œ๋ณธ ์„ธํŠธ ์˜ ๊ฐ mongod ํ”„๋กœ์„ธ์Šค ๋Š” ๊ณ ์œ ํ•˜๊ฒŒ ์ฃผ์†Œ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

      ๋ณต์ œ๋ณธ ์„ธํŠธ ๊ตฌ์„ฑ์˜ ํ”„๋กœ์„ธ์Šค์—๋Š” ํ•ด๋‹น Pod ์„œ๋น„์Šค์˜ FQDN: <om_resource_name>-db-<cluster_index>-<pod_index>-svc.<namespace>.svc.cluster.local ๋กœ ๊ตฌ์„ฑ๋œ ํ”„๋กœ์„ธ์Šค ํ˜ธ์ŠคํŠธ ์ด๋ฆ„์ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    • ๊ฐ Pod์—๋Š” Persistent Volume Claim ์„ ํ†ตํ•ด ์—ฐ๊ฒฐ๋œ ์˜๊ตฌ ๋ณผ๋ฅจ์ด ์žˆ์Šต๋‹ˆ๋‹ค. Kubernetes Operator๊ฐ€ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ๋ชจ๋“  mongod ํ”„๋กœ์„ธ์Šค์—์„œ ๋ณต์ œ๋ณธ ์„ธํŠธ ๋ฅผ ๊ตฌ์„ฑํ•˜๋ ค๋ฉด ๊ฐ ํ”„๋กœ์„ธ์Šค ๊ฐ€ ๋ณต์ œ ๋ชฉ์ ์œผ๋กœ ์„œ๋กœ ์—ฐ๊ฒฐ๋˜์–ด์•ผ ํ”„๋กœ์„ธ์Šค . ์ด๋ฅผ ๋‹ฌ์„ฑํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋ฐฐํฌ ํ•˜๋Š” ๋ชจ๋“  ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๋™์ผํ•œ ์„œ๋น„์Šค ๋ฉ”์‹œ ๊ตฌ์„ฑ์— ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

      ์„œ๋น„์Šค ๋ฉ”์‹œ๋Š” ํด๋Ÿฌ์Šคํ„ฐ ๊ฐ„ DNS ์ฟผ๋ฆฌ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ด์— ๋”ฐ๋ผ ํŠธ๋ž˜ํ”ฝ์„ ๋ผ์šฐํŒ…ํ•ฉ๋‹ˆ๋‹ค. ์„œ๋น„์Šค ๋ฉ”์‹œ๋Š” ๋ชจ๋“  ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ๊ฐ Pod ์„œ๋น„์Šค์˜ FQDN <om_resource_name>-db-<cluster_index>-<pod-index>-svc.<namespace>.svc.cluster.local ๋ฅผ ํ™•์ธํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋˜๋ฉฐ ๋…ธ์ถœ๋œ mongod ํฌํŠธ(๊ธฐ๋ณธ์ ์œผ๋กœ 27017 )์—์„œ ์—ฐ๊ฒฐ์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

      ์˜ˆ๋ฅผ ๋“ค์–ด, Member Cluster 1 ์˜ om-db-1-0 ํŒŒ๋“œ์—์„œ ์‹คํ–‰ ์ค‘์ธ mongod ํ”„๋กœ์„ธ์Šค๊ฐ€ Member Cluster 2 ์˜ om-db-2-1 ํŒŒ๋“œ์—์„œ ์‹คํ–‰ ์ค‘์ธ mongod ์— ์—ฐ๊ฒฐ๋˜๋ฉด, ์ฒซ ๋ฒˆ์งธ mongod ํ”„๋กœ์„ธ์Šค๋Š” ์ž๋™ํ™” ์˜ ํ˜ธ์ŠคํŠธ ์ด๋ฆ„์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ตฌ์„ฑ, om-db-2-1-svc.om-ns.svc.cluster.local:27017 ๋ฐ ์„œ๋น„์Šค ๋ฉ”์‹œ๋Š” ์ด ์š”์ฒญ์„ Member Cluster 2 om-db-2-1-svc ์„œ๋น„์Šค๋กœ ๋ผ์šฐํŒ…ํ•ฉ๋‹ˆ๋‹ค. ์„œ๋น„์Šค ๋ฉ”์‹œ๊ฐ€ ์—†์œผ๋ฉด Kubernetes Member Cluster 1 ์— Member Cluster 2 ์— ๋ฐฐํฌ๋œ om-db-2-1-svc ์„œ๋น„์Šค์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ์—†์œผ๋ฏ€๋กœ om-db-2-1-svc.om-ns.svc.cluster.local ์˜ DNS ํ™•์ธ์ด ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.

    • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ธ์Šคํ„ด์Šค๊ฐ€ Running ์ƒํƒœ ์ธ ๊ฒฝ์šฐ, Kubernetes Operator๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค StatefulSet์— ๋ชจ๋‹ˆํ„ฐ๋ง ์ปจํ…Œ์ด๋„ˆ ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ๋ชจ๋“  ํด๋Ÿฌ์Šคํ„ฐ์˜ ๋ชจ๋“  ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํŒŒ๋“œ๊ฐ€ ๋กค๋ง ์žฌ์‹œ์ž‘ ๋ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋Š” ๋ชจ๋“  ํด๋Ÿฌ์Šคํ„ฐ์—์„œ StatefulSet๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ๋กค๋ง ์žฌ์‹œ์ž‘ ํ”„๋กœ์„ธ์Šค ์ค‘์— ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์—์„œ ํ•˜๋‚˜์˜ ๋ณต์ œ๋ณธ ์„ธํŠธ ๋ฉค๋ฒ„๋งŒ ์ผ์‹œ์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

    • ๋ชจ๋‹ˆํ„ฐ๋ง MongoDB Ops Manager MongoDB Ops Manager ์—์ด์ „ํŠธ ๋Š” ์„œ๋น„์Šค์˜ FQDN<om_resource_name>-svc.<namespace>.svc.cluster.local ๋˜๋Š” ์ง€์ •ํ•œ ๊ฒฝ์šฐ ์˜ spec.opsManagerURL ๊ฐ’์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ธ์Šคํ„ด์Šค์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

      MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ๋ฐฑ์—… ๋””๋จผ ์€ ํ•ญ์ƒ ๋ชจ๋“  ๋ณต์ œ๋ณธ ์„ธํŠธ ๋ฉค๋ฒ„๊ฐ€ ํฌํ•จ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋Œ€ํ•œ ์—ฐ๊ฒฐ string ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ string ์€ ํ•ญ์ƒ pod๋ณ„ ์„œ๋น„์Šค FQDN์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  8. Kubernetes Operator๋Š” spec.backup.enabled ๋ฅผ true ๋กœ ์„ค์ •ํ•œ ๊ฒฝ์šฐ Backup Daemon StatefulSets๋ฅผ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.

    • spec.clusterSpecList ์— ๋‚˜์—ด๋œ ๊ฐ ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ์—์„œ Kubernetes Operator๋Š” ๋ฐฑ์—… ๋ฐ๋ชฌ ์ธ์Šคํ„ด์Šค ์ˆ˜๊ฐ€ spec.backup.members๋กœ ์„ค์ •๋œ <om_resource_name>-backup-daemon-<cluster_index> ์ด๋ผ๋Š” ์ด๋ฆ„์˜ ๋ฐฑ์—… ๋ฐ๋ชฌ StatefulSet๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

      ๋˜๋Š” spec.clusterSpecList[*].backup.members์—์„œ ๊ฐ ํด๋Ÿฌ์Šคํ„ฐ ์˜ ๋ฐฑ์—… ๋””๋จผ ์ธ์Šคํ„ด์Šค ์ˆ˜๋ฅผ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    • ๋ฐฑ์—… ๋ฐ๋ชฌ ์ธ์Šคํ„ด์Šค๋Š” MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ธ์Šคํ„ด์Šค์™€ ๋™์ผํ•œ ์—ฐ๊ฒฐ string ์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ณต์ œ๋ณธ ์„ธํŠธ์—๋งŒ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

๋˜ํ•œ ์ด ๋‹ค์ด์–ด๊ทธ๋žจ์—์„œ๋Š” ์„œ๋น„์Šค ๋ฉ”์‹œ์™€ ๊ตฌ์„ฑ ์š”์†Œ ๊ฐ„์˜ ๋„คํŠธ์›Œํ‚น ์—ฐ๊ฒฐ์„ ๊ด€์ฐฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ๋‹ค์ด์–ด๊ทธ๋žจ์„ ๋‘˜๋Ÿฌ์‹ผ ์ ์„ ์€ ๋ชจ๋“  ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•œ ๋„คํŠธ์›Œํ‚น ๊ตฌ์„ฑ์„ ํฌํ•จํ•˜๋Š” ๋‹จ์ผ ์„œ๋น„์Šค ๋ฉ”์‹œ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

  • ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ ์ „์ฒด์—์„œ MongoDB Ops Manager ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋‘˜๋Ÿฌ์‹ผ ์ ์„ ์€ ์ด๋Ÿฌํ•œ ์ธ์Šคํ„ด์Šค๊ฐ€ ์ƒํƒœ๋ฅผ ์ €์žฅํ•˜์ง€ ์•Š์œผ๋ฉฐ ๋ผ์šด๋“œ ๋กœ๋นˆ ๋กœ๋“œ ๋ฐธ๋Ÿฐ์„œ ๋ฅผ ์˜ˆ์‹œ ํ•˜๋Š” ๋“ฑ ํŠธ๋ž˜ํ”ฝ์„ ๋ชจ๋“  ์ธ์Šคํ„ด์Šค์— ๊ท ๋“ฑํ•˜๊ฒŒ ๋ถ„์‚ฐ๋œ ํ•  ์ˆ˜ ์žˆ์Œ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

  • ๋ฉค๋ฒ„ ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋‘˜๋Ÿฌ์‹ผ ์ ์„ ์€ ์ด๋Ÿฌํ•œ ์ธ์Šคํ„ด์Šค๊ฐ€ ์„œ๋กœ ํ†ต์‹ ํ•˜์—ฌ ๋‹จ์ผ MongoDB ๋ณต์ œ๋ณธ ์„ธํŠธ๋ฅผ ํ˜•์„ฑํ•จ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

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

๋ฉ€ํ‹ฐ ํด๋Ÿฌ์Šคํ„ฐ ๋ฐฐํฌ