KubeCon+CNConに見るetcdの未来

 KubeCon+CNConに見るetcdの未来

A8df61f7319d2c1b4359657b3204ca85?s=128

Akihiro Ikezoe

January 09, 2019
Tweet

Transcript

  1. KubeCon + CNCon ʹݟΔ etcd ͷະདྷ Cloud Native Meetup Tokyo

    #6 2019೥1݄9೔ ஑ఴ ໌޺
  2. • Akihiro IKEZOE (@zoetro) • αΠϘ΢ζגࣜձࣾۈ຿ • Πϯϑϥ࡮৽ϓϩδΣΫτ • ࣗࣾσʔληϯλʔʹKubernetesΫϥελΛߏங

    • αʔόʔػࡐͷϥΠϑαΠΫϧ؅ཧͷࣗಈԽ΍ɺKubernetesΫϥελͷӡ༻ࣗ ಈԽπʔϧΛ։ൃ͍ͯ͠Δ 2 ࣗݾ঺հ
  3. KubeCon + CloudNativeCon North America 2018 • αΠϘ΢ζ͔Β͸7໊ͰࢀՃ͠·ͨ͠ɻ • KubeCon

    + CloudNativeCon North America 2018 ݱ஍Ϩϙʔτ • IUUQTCMPHDZCP[VJPFOUSZ • IUUQTCMPHDZCP[VJPFOUSZ • IUUQTCMPHDZCP[VJPFOUSZ • IUUQTCMPHDZCP[VJPFOUSZ 3
  4. etcdؔ࿈ηογϣϯ • Keynote: 5 Years of etcd: Past, Present, and

    Future • What's Next for etcd Cluster Management? • Intro: Cluster Lifecycle SIG • Debugging etcd • Deep Dive: etcd 4
  5. etcd • CoreOSࣾ(ݱRed Hatࣾ)͕։ൃ͢Δ෼ࢄΩʔόϦϡʔετΞ • ಛ௃ • )JHI"WBJMBCMF • 4USPOH$POTJTUFODZ.PEFM

    • 3BGUʹΑΔ෼ࢄ߹ҙ • 5SBOTBDUJPO 8BUDI -FBTF • ϦʔμʔΤϨΫγϣϯͳͲ෼ࢄγεςϜʹඞཁͳػೳΛఏڙ • Kubernetes, Vitess, CoreDNSͳͲ਺ଟ͘ͷ෼ࢄγεςϜͷόο ΫΤϯυͱͯ͠ར༻͞Ε͍ͯΔɻ 5
  6. etcdͷະདྷ Keynote: 5 Years of etcd: Past, Present, and Future

  7. CoreOSࣾͷOSS͸Ͳ͏ͳΔͷ͔ʁ • CoreOS͕Red Hatʹങऩ͞ΕɺRed Hat΋IBMʹങऩ͞ΕΔ༧ఆɻ • Container Linux • 'FEPSB$PSF04͕ޙܧͱͳΔɻ

    • ೥͍ͬͺ͍͸ϝϯςφϯε͞ΕΔ༧ఆɻ • rkt • 3FE )BUͱͯ͠։ൃ͸ܧଓ͠ͳ͍ɻ'FEPSB$PSF04ʹ΋౥ࡌ͞Εͳ͍ɻ • etcd • Ͳ͏ͳΔʁ 7
  8. https://www.cncf.io/blog/2018/12/11/cncf-to-host-etcd/ 8

  9. etcd͕CNCFϓϩδΣΫτʹ • Red Hat͔ࣾΒCNCFʹدଃ͞Εͨɻ • etcdͷϝϯςφ͸΋ͱ΋ͱCoreOSͷ֎ͷਓ͕ଟ͍ͷͰɺ ։ൃମ੍ʹେ͖ͳมԽ͸ͳͦ͞͏ɻ • ࠓޙ͸࢖͍΍͢͞΍҆ఆੑ΍ੑೳͷվળͳͲ͕த৺ɻ •

    υΩϡϝϯτͷ੔උ΋ظ଴͞ΕΔɻ 9
  10. etcdͷ৽ػೳ What's Next for etcd Cluster Management?

  11. ࠓޙetcdʹಋೖ͞ΕΔػೳ • 3BGU-FBSOFS FUDEW  • FUDEPQFSBUPS1FSTJTUFOU7PMVNF4VQQPSU FUDEPQFSBUPSW  •

    4FSWFS%PXOHSBEF FUDEW  • $MVTUFSJOJU ఏҊத 11
  12. 3BGU-FBSOFS 12

  13. • ωοτϫʔΫ෼அ΍ύέοτϩεͳͲͷো֐͕ൃੜ͠ ͯ΋ɺσʔλͷෆ੔߹Λൃੜͤ͞ͳ͍͜ͱΛอূ͢Δɻ • Ϋϥελ಺͔ΒϦʔμʔΛબग़͢Δɻ Ϧʔμʔ͔ΒଞͷϝϯόʔʹϋʔτϏʔτΛૹ৴͠ Ϧʔμʔ͕1͔͍ͭ͠ͳ͍͜ͱΛอূ͢Δɻ • ϦʔμʔΛؚΉա൒਺ͷϝϯόʔ͕߹ҙͨ͠ͱ͖ʹ σʔλΛίϛοτ͢Δ͜ͱ͕Ͱ͖Δɻ

    13 Raft: etcdͷ෼ࢄ߹ҙΞϧΰϦζϜ
  14. Network Partition (Split Brain) https://youtu.be/5kAVOQ4APok 14

  15. • Ϋϥελʹ৽͍͠ϝϯόΛ௥Ճͨ͠ͱ͖ɺσʔλͷಉظ͕׬ྃ ͢Δ·Ͱʹ͕͔͔࣌ؒΔɻ • σʔλͷಉظ͕׬͍ྃͯ͠ͳ͍ϝϯόʔ΋ɺ෼ࢄ߹ҙͷϝϯ όʔͱͯ͠Χ΢ϯτ͞ΕΔɻ 15 ݱঢ়ͷ໰୊఺ʢલఏʣ

  16. • σʔλಉظத͸I/Oෛՙ͕ߴ͍ɻϦʔμʔ͔ΒͷϋʔτϏʔτ ϦΫΤετͷλΠϜΞ΢τ͕ൃੜ͠΍͘͢ͳΔɻ • σʔλಉظதʹωοτϫʔΫ෼அ͕ൃੜ͢ΔͱɺຊདྷͳΒো֐ ʹ଱͑͏ΔέʔεͰ΋Ϋϥελ่յ͕ൃੜͯ͠͠·͏ɻ • ϝϯόʔΛ௥Ճ͢Δͱ͖ʹىಈύϥϝʔλΛϛε͍ͬͯΔͱɺ Quorum Size͚ͩ૿͑ͯނোͨ͠ϝϯόʔ͕Ϋϥελʹ௥Ճ͞

    Εͯ͠·͏ɻ 16 ݱঢ়ͷ໰୊఺
  17. 17 σʔλಉظલͷωοτϫʔΫ෼அ https://youtu.be/5kAVOQ4APok

  18. Raft Learner 18 https://youtu.be/5kAVOQ4APok

  19. $MVTUFSJOJU 19

  20. etcdͷىಈΦϓγϣϯ 20

  21. • etcdΫϥελΛ্ཱͪ͛ΔͨΊʹ͸ɺϝϯόʔ͝ͱʹ໊લ΍ɺ Ϧοεϯ͢ΔΞυϨεɺଞͷϝϯόʔʹ޿ࠂ͢ΔURLΛࢦఆ͢ Δඞཁ͕͋Δɻ • ͜ΕΒͷύϥϝʔλΛࢦఆ͠ͳͯ͘΋ɺDNSΛར༻ͯ͠ɺࣗಈ తʹ໊લ΍ΞυϨεΛղܾ͢Δ࢓૊Έ͕ఏҊ͞Ε͍ͯΔɻ • etcdϝϯόʔͷ্ཱ͕ͪ͛ඇৗʹ؆୯ʹͳΔʂ 21

    Cluster init
  22. etcdadm Intro: Cluster Lifecycle SIG

  23. etcdͷӡ༻͸େม • etcd͸ඇৗʹ؆୯ʹ࢖͍࢝ΊΔ͜ͱ͕Ͱ͖Δɻ • ͔͠͠ɺຊ൪؀ڥͰӡ༻͠Α͏ͱࢥ͏ͱɺHAߏ੒ʹͨ͠Γɺ ূ໌ॻΛ؅ཧͨ͠ΓɺΫϥελ่͕յ͠ͳ͍Α͏ʹϝϯόΛ௥ Ճɾ࡟আͨ͠Γɺ͍Ζ͍Ζ೉͍͠ɻ • ӡ༻ΛࣗಈԽ͢Δπʔϧ͕ඞཁͱͳΔ •

    Kubernetes্ͷetcdΫϥελͷӡ༻ ὎ FUDEPQFSBUPS • ࣮ػ΍VM্ͷetcdΫϥελͷӡ༻͸ʁ 23
  24. etcdadm https://youtu.be/vtBc0f1ACbM 24

  25. • ࣮ػ΍7.޲͚ͷFUDEΫϥελӡ༻ࣗಈԽπʔϧ • ,VCFSOFUFT LVCFBQJTFSWFS ޲͚ʹಛԽ • $MVTUFS-JGFDZDMF 4*(ʹͯఏҊத •

    QMBUGPSNFUDEBEN ͱ LPQFJPFUDENBOBHFS Λϕʔεʹ࣮ͯ͠૷͕ਐΊΒΕΔ༧ఆɻ • FUDEΫϥελͷߏங΍ӡ༻ΛࣗಈԽͯ͘͠ΕΔ • ϝϯόʔͷ௥Ճ΍࡟আ • όοΫΞοϓͱϦετΞ σΟβελʔϦΧόϦʔ • ΞοϓάϨʔυɺμ΢ϯάϨʔυ • ূ໌ॻͷ؅ཧ 25 etcdadm
  26. τϥϒϧγϡʔςΟϯά Debugging etcd

  27. σόοάͷΞϓϩʔν https://youtu.be/NVMZBBQ9hsM 27

  28. σόοάʹศརͳπʔϧ • etcdctl • FUDEΛૢ࡞͢ΔͨΊͷඪ४πʔϧɻ • auger • ,VCFSOFUFT͸QSPUPCVGܗࣜͰFUDEʹσʔλΛ֨ೲ͍ͯ͠Δɻ •

    ͜ͷσʔλΛσίʔυͯ͠දࣔͯ͘͠ΕΔπʔϧɻ • etcd-dump-logs • 8"-ͷMPHΛμϯϓͯ͠ɺFUDEʹରͯ͠ͲͷΑ͏ͳૢ࡞͕͓͜ͳΘΕ ͔ͨΛ֬ೝ͢Δ͜ͱ͕Ͱ͖Δπʔϧɻ 28
  29. Q&Aܗࣜͷηογϣϯ Deep Dive: etcd

  30. Deep Dive: etcd https://youtu.be/GJqO1TYzVDE 30

  31. ؾʹͳͬͨQ&A • ͳͥσʔλαΠζʹ੍ݶ͕͋Δͷ͔ʁ • σϑΥϧτͰ2GBʢ࠷େ8GBʣͷ੍ݶ͕͋Δɻ • σʔλϕʔεϑΝΠϧΛmmap͢ΔͨΊɺσʔλྔ෼ͷϝϞϦ͕ඞཁɻ • ͳͥίϯύΫγϣϯ͕ඞཁͳͷ͔ʁ •

    Ωʔ͝ͱͷཤྺΛอ͍࣋ͯ͠Δɻ • ݹ͍ཤྺΛ࡟আ͠ͳ͍ͱɺσʔλ༰ྔ͕૿͑ϦετΞ࣌ؒ΋૿େ͢Δɻ • ͳͥI/OϨΠςϯγʹහײͳͷ͔ʁ • ఆظతʹϦʔμʔ͔ΒϑΥϩϫʔʹϋʔτϏʔτΛૹ৴ͯ͠ɺ෼ࢄ߹ҙͷϝ λσʔλΛϑΝΠϧʹอଘ͍ͯ͠Δɻ • ϑΝΠϧॻ͖ࠐΈ͕஗͍ͱϋʔτϏʔτ͕λΠϜΞ΢τ͢Δɻ(v3.4Ͱվળʁ) • ग़དྷΔ͚ͩSSDΛ࢖͏΂͖ɻ 31
  32. ·ͱΊ

  33. ·ͱΊ • etcd͸KubernetesΛ࢝Ί͍Ζ͍Ζͳͱ͜ΖͰ࢖ΘΕ͍ͯͯɺ ͳͯ͘͸ͳΒͳ͍ଘࡏɻ • CNCFϓϩδΣΫτʹՃΘͬͨ͜ͱ΋͋Γɺࠓޙͷϝϯςφϯ ε͸҆৺ͯ͠ྑͦ͞͏ɻ • ։ൃऀ޲͚ͷେ͖ͳ৽ػೳ͸͋·Γͳͦ͞͏͚ͩͲɺӡ༻ऀ޲ ͚ʹ͸خ͍͠ػೳ͕͍Ζ͍Ζग़͖ͯͦ͏ɻ

    33