Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DBA is free! MongoDB 자동 업그레이드 시스템 개발기

kakao
November 01, 2024

DBA is free! MongoDB 자동 업그레이드 시스템 개발기

#MongoDB #Database #DBaaS #Upgrade #Platform

사내의 수많은 데이터베이스를 업그레이드하는 과정은 복잡한 커뮤니케이션과 반복적인 작업으로 고통스러운 과정입니다.
카카오의 분산데이터베이스 조직에서는 MongoDB 자동 업그레이드 플랫폼 MUA를 구축하여, 사내 대규모 MongoDB를 편리하게 업그레이드하고 운영 비용을 크게 절감하였습니다.
이 경험을 소개하고자 합니다.

발표자 : ayla.c
자유를 얻은 DBA 아일라입니다. 카카오의 분산데이터베이스 조직에서 전사 MongoDB 관리를 담당하고 있습니다.

kakao

November 01, 2024
Tweet

More Decks by kakao

Other Decks in Programming

Transcript

  1. ੣਷6QHSBEF ؊੣਷&0-        

        W W W W W W W W W W 3FMFBTF &0- ࢎղ.POHP%#ߡ੹಴ળ
  2. .POHP%#ҳࢿߑध    4IBSE 4IBSE $PO fi H4FSWFS .POHPT

    3PVUFST PSNPSF3PVUFST PSNPSF4IBSET   4IBSEFE$MVTUFS
  3.    4IBSEFE$MVTUFSসӒۨ੉٘ DPO fi H -> TIBSET ->

    NPOHPT DPO fi H TIBSET NPOHPT .POHP%#ҳࢿߑध 4IBSE 4IBSE $PO fi H4FSWFS .POHPT 3PVUFST PSNPSF3PVUFST PSNPSF4IBSET
  4. +FOLJOT "SDIJUFDUVSF ,BLBP 
 -%"14ZTUFN %FWFMPQFS %#" ਃ୒੗੿ࠁ ۽Ӓੋ .Z42-

    .POHP%# ੌ੿١۾ ઑഥ ੘স૑द Ѿҗ߈ജ ੗زসӒۨ੉٘૑द .6" 4DIFEVMFS /PUJ fi FS $PSF 5BTL +PC 4UFQ TTIUDQ LBLBPXPSL $MVTUFSNFUB 4DIFEVMFT +PCIJTUPSJFT 4FSWFSMPHT "VUIFOUJDBUJP O "VUIPSJ[BUJPO 5BSHFU$MVTUFS NHPDPOG %#BB4 1PSUBM #BDLFOE ঌܻܿನ౟
  5. +FOLJOT "SDIJUFDUVSF ,BLBP 
 -%"14ZTUFN %FWFMPQFS %#" ਃ୒੗੿ࠁ ۽Ӓੋ .Z42-

    .POHP%# ੌ੿١۾ ઑഥ ੘স૑द Ѿҗ߈ജ ੗زসӒۨ੉٘૑द TTIUDQ LBLBPXPSL "VUIFOUJDBUJP O "VUIPSJ[BUJPO 5BSHFU$MVTUFS %#BB4 1PSUBM #BDLFOE .6" 4DIFEVMFS /PUJ fi FS 5BTL +PC 4UFQ NHPDPOG $MVTUFSNFUB 4DIFEVMFT +PCIJTUPSJFT 4FSWFSMPHT ঌܻܿನ౟ $PSF
  6. +FOLJOT "SDIJUFDUVSF ,BLBP 
 -%"14ZTUFN %FWFMPQFS %#" ਃ୒੗੿ࠁ ۽Ӓੋ .Z42-

    .POHP%# ੌ੿١۾ ઑഥ ੘স૑द Ѿҗ߈ജ ੗زসӒۨ੉٘૑द TTIUDQ LBLBPXPSL "VUIFOUJDBUJP O "VUIPSJ[BUJPO 5BSHFU$MVTUFS %#BB4 1PSUBM #BDLFOE .6" 4DIFEVMFS /PUJ fi FS 5BTL +PC 4UFQ NHPDPOG $MVTUFSNFUB 4DIFEVMFT +PCIJTUPSJFT 4FSWFSMPHT ঌܻܿನ౟ $PSF
  7. +FOLJOT "SDIJUFDUVSF ,BLBP 
 -%"14ZTUFN %FWFMPQFS %#" ਃ୒੗੿ࠁ ۽Ӓੋ .Z42-

    .POHP%# ੌ੿١۾ ઑഥ ੘স૑द Ѿҗ߈ജ ੗زসӒۨ੉٘૑द TTIUDQ ঌܻܿನ౟ LBLBPXPSL "VUIFOUJDBUJP O "VUIPSJ[BUJPO 5BSHFU$MVTUFS %#BB4 1PSUBM #BDLFOE .6" 4DIFEVMFS /PUJ fi FS 5BTL +PC 4UFQ NHPDPOG $MVTUFSNFUB 4DIFEVMFT +PCIJTUPSJFT 4FSWFSMPHT $PSF
  8. 'FBUVSFT "MFSU ੌ੹ ࠙ द੘ ৮ܐ 1. ".द .PSOJOH3FQPSU &WFOJOH3FQPSU

    %FWFMPQFS %#" সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ
  9. .PSOJOH3FQPSU &WFOJOH3FQPSU %#" সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ 'FBUVSFT "MFSU ੌ੹ ࠙

    द੘ ৮ܐ 1. ".द %FWFMPQFS সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ
  10. %FWFMPQFS সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ 'FBUVSFT "MFSU ੌ੹ ࠙ द੘ ৮ܐ

    1. ".द .PSOJOH3FQPSU &WFOJOH3FQPSU %#" সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ
  11. ੌ੹ द੘ ৮ܐ 1. ".द &WFOJOH3FQPSU সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ .PSOJOH3FQPSU সӒۨ੉٘ঌܿ

    সӒۨ੉٘ঌܿ 'FBUVSFT "MFSU ࠙ %FWFMPQFS %#" সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ ࠄ੗ܐח৘दؘ੉ఠ۽੘ࢿغ঻णפ׮
  12. ੌ੹ ࠙ द੘ ৮ܐ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ সӒۨ੉٘ঌܿ

    'FBUVSFT "MFSU %FWFMPQFS %#" ࠄ੗ܐח৘दؘ੉ఠ۽੘ࢿغ঻णפ׮ 1. ".द .PSOJOH3FQPSU &WFOJOH3FQPSU
  13. 'FBUVSFT 4BGFUZ'JSTU ↟ ࢲ࠺झী੢গоߊࢤೞ૑ঋب۾সӒۨ੉٘উ੿ࢿਸ୭਋ࢶਵ۽Ҋ۰ ݵ١ࢿࠁ੢ ೞա੄֢٘ীزੌ੘স ߈ࠂࣻ೯оמ DSBTIоߊࢤ೧ب ܀ߔহ੉੤ࣻ೯оמ ୍੷ೠ7BMJEBUJPO

    ୨ѐWBMJEBUJPO೦ݾ ࠗ࠙੗زച઺ോݢী۞ରױ ੢গߊࢤоמࢿ੉੓ח҃਋ ૊द੘স઺ױ ഐജࢿ੉गߊࢤद 
 সӒۨ੉٘੉੹ਵ۽ࠂҳ ׮਍Ӓۨ੉٘ ࠺࢚द௿۞झఠ੄ 
 ੹୓੘স઺ױ ࠺࢚઺ױ
  14. $IBMMFOHFT সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF ױੌۨ೒ܻ஠ࣇࢥ٘௿۞झఠৈࠗীٮ࢚ܲ੉ೠ೐۽ࣁझ ࢥ٘௿۞झఠחDPO fi H -> TIBSE -> NPOHPTࣽࢲо੿ഛ൤૑ெઉঠೣ

    ࢲ࠺झ৔ೱبীٮܲ৮੹੗زചࠗ࠙੗زച ۨ೒ܻ஠ࣇղ੄֢ٜ٘਷زदী੘সࣻ೯ࠛо ࢲ۽׮ܲࢥ٘੄֢ٜ٘਷زदীࣻ೯ؼࣻ੓਺
  15. $IBMMFOHFT ױੌۨ೒ܻ஠ࣇࢥ٘௿۞झఠৈࠗীٮ࢚ܲ੉ೠ೐۽ࣁझ ࢥ٘௿۞झఠחDPO fi H -> TIBSE -> NPOHPTࣽࢲо੿ഛ൤૑ெઉঠೣ ࢲ࠺झ৔ೱبীٮܲ৮੹੗زചࠗ࠙੗زച

    <>.POHPT <>4IBSE <>$PO fi H <>4IBSE সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF ࢲ۽׮ܲࢥ٘੄֢ٜ٘਷زदীࣻ೯ؼࣻ੓਺ ۨ೒ܻ஠ࣇղ੄֢ٜ٘਷زदী੘সࣻ೯ࠛо
  16. $IBMMFOHFT ױੌۨ೒ܻ஠ࣇࢥ٘௿۞झఠৈࠗীٮ࢚ܲ੉ೠ೐۽ࣁझ ࢲ۽׮ܲࢥ٘੄֢ٜ٘਷زदীࣻ೯ؼࣻ੓਺ ࢲ࠺झ৔ೱبীٮܲ৮੹੗زചࠗ࠙੗زച .POHPT 4IBSE 4IBSE $PO fi H

    সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF ۨ೒ܻ஠ࣇղ੄֢ٜ٘਷زदী੘সࣻ೯ࠛо ࢥ٘௿۞झఠחDPO fi H -> TIBSE -> NPOHPTࣽࢲо੿ഛ൤૑ெઉঠೣ
  17. $IBMMFOHFT ױੌۨ೒ܻ஠ࣇࢥ٘௿۞झఠৈࠗীٮ࢚ܲ੉ೠ೐۽ࣁझ ࢲ࠺झ৔ೱبীٮܲ৮੹੗زചࠗ࠙੗زച .6" 5BSHFU.POHP%#$MVTUFS %#" .6" 5BSHFU.POHP%#$MVTUFS ࠗ࠙੗زച ৮੹੗زച

    সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF ۨ೒ܻ஠ࣇղ੄֢ٜ٘਷زदী੘সࣻ೯ࠛо ࢲ۽׮ܲࢥ٘੄֢ٜ٘਷زदীࣻ೯ؼࣻ੓਺ ࢥ٘௿۞झఠחDPO fi H -> TIBSE -> NPOHPTࣽࢲо੿ഛ൤૑ெઉঠೣ
  18. 45&1 +0# +0# 5"4, $IBMMFOHFT 5"4, +0# $PO fi H

    5"4, 5"4, 5"4, 5"4, .POHPT +0# 5"4, +0# 5"4, 4IBSE 5"4, 5"4, 4IBSE 5"4, 5"4, 5"4, সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF
  19. $IBMMFOHFT সӒۨ੉٘೐۽ࣁझ੄ࠂ੟ࢿMBZFS4USVDUVSF 5JNF 4FSWJDF 4UFQ +PC 5BTL ৮੹੗ز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PSUFE "CPSUFE "CPSUFE 4UFQ +PC +PC ࠺࢚઺ױ4UFQ઺ױ +PC ઱ӝ੸ਵ۽DIFDL
  23. $IBMMFOHFT $PO fi H'JMF&WPMVUJPO W W "২࣌ઁѢ W $২࣌ઁѢ W

    #২࣌୶о -FHBDZ২࣌ਵ۽ੋೠഐജࢿޙઁ नӏߡ੹ীࢲ੿଼੸ਵ۽୶оغযঠೞח২࣌߈৔
  24. $IBMMFOHFT $PO fi H'JMF&WPMVUJPO W W "২࣌ઁѢ W $২࣌ઁѢ W

    #২࣌୶о -FHBDZ২࣌ਵ۽ੋೠഐജࢿޙઁ नӏߡ੹ীࢲ੿଼੸ਵ۽୶оغযঠೞח২࣌߈৔
  25. $IBMMFOHFT $PO fi H'JMF&WPMVUJPO п֢٘ח%#ҳࢿ߂ࢲ࠺झౠࢿীٮۄ࢚੉ೠ২࣌ਸࢎਊೞҊ੓਺ ӝઓ੄ࢸ੿਷ਬ૑ೞغ ઁѢ୶оغযঠೞח২࣌݅߸҃೙ਃ OptionA: enabled: true

    legacy: 100 OptionB: "all" /PEF" /PEF# /PEF$ OptionA: enabled: true legacy: 50 OptionC: "none" OptionA: enabled: true OptionB: "all" ZBNMਸHPTUSVDU۽߸ജೞৈࣻ੿ೞחݽٕ NHPDPOG ੘ࢿ
  26. $IBMMFOHFT $PO fi H'JMF&WPMVUJPONHPDPOG B MFHBDZ  ӝઓ$PO fi H੄чਸNHPDPOGী੿੄ػ%FGBVMU$PO

    fi HীPWFSXSJUF NHPDPOG B CBMM MFHBDZ  B  B OFXUSVF  B CBMM OFXUSVF  B OFXUSVF  B C VOEF fi OFE OFXUSVF <%FGBVMU>
  27. $IBMMFOHFT $PO fi H'JMF&WPMVUJPO 5BSHFU%# "EEOFX fi FMETEFUFSNJOFECZPSHBOJ[BUJPOsTQPMJDZ mgoconf.SetValue(“a.b.c”, “example”)

    .BSTIBMMJOHUPZBNM 1BSTJOHZBNMUPHPMBOHTUSVDU mgoconf.New(“5.0”) 3FBEDPO fi H TDQ 4FSWFS$PO fi H'JMF 8SJUFDPO fi H TDQ NHPDPOG .BQQJOHDPO fi HUPOFXWFSTJPO mgoconf.To(“6.0”) -FHBDZ fi FMETXJMMCFSFNPWFEJOUIJTTUFQ ӝઓ੄%#ࢸ੿਷ਬ૑ೞغ ഐജغ૑ঋח২࣌݅ࣻ੿  ઑ૒ղ੿଼ীٮۄ ੸੺ೠWBMVFࣁ౴  ਬ૑ࠁࣻ߂੤ࢎਊݾ੸ 
 ࢎղHPMBOHMJCSBSZഋక۽ܻ࠙  $IBMMFOHFT $PO fi H'JMF&WPMVUJPONHPDPOG
  28. ੌ੿١۾ ࠙ ੗زসӒۨ੉٘ _࠙ ੘স੹റঌܿ ੌ੿ഈ੄ _઱ ࣻزসӒۨ੉٘ _࠙ ߈ࠂ੸ੋ

    ழޭפா੉࣌ زद੘সࠛо %#"р੘স࠙׸ زद੘সоמ 
 ৡ௒੹׸ $PODMVTJPO সӒۨ੉٘೐۽ࣁझѐࢶ ӝઓ അ੤ ੺х %#"੘স࠺ਊ
  29. 2"