ペパボにおけるOpenStackHacks!

 ペパボにおけるOpenStackHacks!

GMO Pepabo.incのOpenStack運用事例です。

1b838da2065660793d5b26f2cdc32de7?s=128

Kazuhiko Yamashita

July 04, 2015
Tweet

Transcript

  1. d๻ͱՆΛҰॹʹτΡΪϟβʔ͠·ઐՊʂʂฤd GMO Pepabo, Inc. Pࢁ 2015/07/04 Pepabo Tech Conference in

    Fukuoka ϖύϘʹ͓͚Δ
 0QFO4UBDL)BDLT
  2. Ͳ΋ɺ΅͘Ͱ͢  1ࢁ  (.01FQBCP*OD  !QZBNB UFOTOBQPODPN

  3. "HFOEB  0QFO4UBDLJT  /ZBIJT  IBDLT  ࠓ΍ͬͯΔ͜ͱ

  4. 0QFO4UBDLJT Ϋϥ΢υج൫ 7.Λ؅ཧ͢ΔͨΊͷ
 ιϑτ΢ΣΞ܈

  5. ߏ੒ਤ /PWB"1* )PSJ[PO ,FZTUPOF /PWB$PNQVUF ෺ཧϗετ /FVUSPO $JOEFS HMBODF ͜Μͳ7.࡞Γ͍ͨ

    ͜ͷϢʔβʔݖݶ ͋Δʁ ࢖༻͢ΔΠϝʔδ 04͸͜Ε σΟεΫ͸͜͜Λ ࢖͏ $16ɼϝϞϦ͸ ͜Ε ࢖༻͢ΔωοτϫʔΫ͸͜Ε ΦϨΦϨʂԶͩΑʂ
  6. ϖύϘ͕ղܾͨ͠ ͔ͬͨ͜ͱ

  7. ݸʑͷαʔϏεͰಠࣗʹΠϯϑϥΛߏங

  8. αʔόΛؾܰʹ࡞Γ͍ͨ ຐ๏ͷΑ͏ʹ؆୯ʹ αʔό࡞Γ͍ͨΘ͊ɻɻ

  9. “2014/05/01 Issueݐઃ αʔϏε͝ͱͰ͸ͳ͘ɺ
 શࣾڞ௨ͷΠϯϑϥج൫Λ࡞Δͧʂʂʂʂ

  10. /ZBI

  11. /ZBIJT  ϖύϘͷԾ૝ج൫Πϯϑϥ  ͜Ε·ͰαʔϏε͝ͱʹઃ͚͍ͯͨ
 Πϯϑϥ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δαʔό
 ؂ࢹαʔϏε  .BDLFSFMḉ  ϩʔϧͰ؂ࢹઃఆΛଋͶΔ͜ͱ͕
 Մೳ

  23. .BDLFSFM NBDLFSFM\ SPMFOZBIOFVUSPOOPEF  DPOG\ NPOJUPS< \ OBNFQMVHJODIFDLTOFVUSPOTFSWFS  DPNNBOEVTSMJCOBHJPTQMVHJOTDIFDL@QSPDTBOFVUSPOTFSWFSD

    ^  \ OBNFQMVHJODIFDLTOFVUSPO  DPNNBOEVTSMJCOBHJPTQMVHJOTDIFDL@UDQ)MPDBMIPTUQXD ^  ʜ > ^ ^
  24. .BDLFSFM /FVUSPO ŠŠ ŠŠ ŠŠ JUBNBFNBDLSFMSC SPMFT<OZBIOFVUSPOOPEF> <QMVHJODIFDLTOFVUSPOTFSWFS> DPNNBOEVTSMJCOBHJPTQMVHJOTDIFDL@QSPDTBOFVUSPOTFSWFSD <QMVHJODIFDLTOFVUSPO>

    DPNNBOEVTSMJCOBHJPTQMVHJOTDIFDL@UDQ)MPDBMIPTUQXDz ʜ NBDLFSFMḉ ࢮ׆ɺ͖͍͠஋؂ࢹ
  25. .BDLFSFM

  26. .BDLFSFM  ઃఆ͸ϗετଆ͚ͩͰ*1ΞυϨεؾʹ ͠ͳ͍͍ͯ͘  ઃఆϑΝΠϧ͕γϯϓϧͰ؅ཧ͠΍͍͢  ؂ࢹఆٛ΋(6*ͰαΫαΫ΍ΕΔ͔ͭɺ Ұ౓ೖΕͯ͠·͑͹͋ͱ͸ಉ͡ϩʔϧ ʹࢀՃͤ͞Δ͚ͩ

  27. /ZBI·ͱΊ  0QFO4UBDL࢖ͬͯ·͢  ϖύϘͷϓϥΠϕʔτΫϥ΢υ  αʔϏε୯ҐͰϦιʔε؅ཧ  ߏ੒؅ཧ͸JUBNBF 

    ؂ࢹ͸NBDLFSFM
  28. )BDLT

  29. य़

  30. େମग़དྷͨ

  31. ͡Ό͋ɺ৮ͬͯΈͯ ͍͍͔͢ʂʂʂ

  32. )PSJ[PO  7.؅ཧ  /8؅ཧ  ηΩϡϦςΟʔ؅ཧ  Ϣʔβʔ؅ཧ 

    Ϧιʔε؅ཧ
  33. 0QFO4UBDL$MJFOU  1ZUIPOͷΫϥΠϯτ  OPWBMJTU  OFVUSPOQPSUMJTU  LFZTUPOFFOEQPJOUMJTU IUUQEPDTPQFOTUBDLPSHKBVTFSHVJEFDPOUFOUJOTUBMM@DMJFOUTIUNM

  34. GNʜ ͡Ό͋ɺԿʁ ୆ϗετ࡞Δͷʹճ 8&#6*ૢ࡞ͨ͠ΓɺίϚϯυ౤ ͛ͳ͖Ό͍͚ͳ͍Θ͚Ͱ͔͢ʁ

  35. ΍ͬͯΒΜͳ͍ʂʂʂ

  36. )BDLT  LBOBNFϢʔβʔ؅ཧ  LBLJOFηΩϡϦςΟάϧʔϓ؅ཧ  OZBIDMJ7.࡞੒  1FD7.T࡞੒

  37. Ϣʔβʔ؅ཧ

  38. LBOBNF  ϖύϘͰ͸ਓͷΤϯδχΞ͕
 ෳ਺ͷαʔϏεʹܞΘΔ  )PSJ[POͩͱมߋཤྺ͕؅ཧͰ͖ͳ͍
 ূ੻͕࢒Βͳ͍

  39. LBOBNF  ઃఆϑΝΠϧΛZBNMͰఆٛ  ઃఆϑΝΠϧΛ(JUʹू໿
 ʮ୭͕ɺ͍ͭɺͲͷݖݶʯΛอ͔࣋ͨ͠Λ؅ཧ QZBNB FNBJMlQZBNB!QFQBCPDPNl UFOBOUT NVVNVVlDJUZCPZ

    EFWFMPQlBENJOz UBOBLB FNBJMlUBOBLB!QFQBCPDPN UFOBOUT EFWFMPQNFOUNFNCFS
  40. LBOBNF ొ࿥಺༰ ,FZTUPOF QZBNB FNBJMlQZBNB!QFQBCPDPNl UFOBOUT NVVNVVlDJUZCPZ EFWFMPQlBENJOz UBOBLB FNBJMlUBOBLB!QFQBCPDPN

    UFOBOUT EFWFMPQNFOUNFNCFS (JU)VC13 ɹొ࿥಺༰ʹޡΓ͕ͳ͍͜ͱΛ
 ɹ֬ೝ͢Δ (JU)VCͰͷϨϏϡʔ׬ྃޙɺొ࿥
  41. ηΩϡϦςΟ؅ཧ

  42. DPNQVUFOPEF ෺ཧϗετ JOUFSGBDF 4FDVSJUZ(SPVQ Ϝʔ7. /PWB"QJ /FVUSPO Ϝʔ7.ʹ͸ΦϑΟε͔Βͷ 44)ڐՄ͍ͨ͠ Ϝʔ7.ʹ44)ڐՄ

    JQUBCMFTఆٛ 7.Ͱ͸ͳ͘DPNQVUFOPEFʹ JQUBCMFTఆٛ
  43. LBLJOF  ઃఆϑΝΠϧΛZBNMͰఆٛ  ઃఆϑΝΠϧΛ(JUʹू໿  ηΩϡϦςΟઃఆͷϨϏϡʔ͕ՄೳʹͳΓɺ
 ·ͨɺొ࿥ɺ੾Γ໭͠ͷख͕ؒେ෯ʹ࡟ݮ JOUFSOBM@QFSNJU SVMFT

    EJSFDUJPOJOHSFTT QSPUPDPM FUIFSUZQF*1W QPSU SFNPUF@JQ EFTDSJQUJPOΠϯλʔφϧઢͷ௨৴ΛશͯڐՄ
  44. LBLJOF طଘઃఆͷऔಘɾฤूɾొ࿥ /PWB"QJ JOUFSOBM@QFSNJU SVMFT EJSFDUJPOJOHSFTT QSPUPDPM FUIFSUZQF*1W QPSU SFNPUF@JQ

    EFTDSJQUJPOΠϯλʔφϧઢͷ௨৴ΛશͯڐՄ ొ࿥͞Εͨ಺༰Λ൓ө ࠷৽ొ࿥಺༰Λ(JU؅ཧ /PWB$PNQVUF /PWB$PNQVUF /PWB$PNQVUF
  45. Πϯελϯε࡞੒

  46. JNBHF

  47. JNBHF TVEPϢʔβʔͷ࡞੒ TTIαʔόʔͷ࣮ߦ DMPVEJOJU PQFOTUBDLBQJDMJFOU QZUIPO ͷ
 Πϯετʔϧ σΟεΫ࠷খԽͱΠϯελϯεىಈ࣌ʹࣗಈ֦ு ωοτϫʔΫॳظԽ

    ϑΝΠΞ΢ΥʔϧͷແޮԽ ೔ຊ࣌ؒΛઃఆ ىಈ࣌ͷTMBDL௨஌
  48. JNBHF  $FOU04   
 XJUIDIFGQVQQFU   6CVOUV

    
 XJUIDIFGQVQQFU   $PSF04ͳͲͳͲ
  49. JOTUBODF JNBHF CBTF &TTFODF QVQQFU DIFG DMPVEJOJU

  50. “Πϝʔδͷىಈ࣌ʹ౉͞Εͨuser-dataʹج͖ͮ OSʹରͯ͠ઃఆΛߦ͑Δ࢓૊Έ $MPVE*OJU DMPVEJOJU DMPVEDPOpH ϦϑΝϨϯε IUUQT[FUUBJPOCIKFMQDPNNVOJUZBSUJLMFSPHPQQMBFSJOHDMPVEJOJUSFGFSFODF

  51. $MPVE*OJU IPTUOBNFQZBNBEFNP GREOQZBNBEFNPDPN SFQP@SFMFBTFWFS VTFST OBNFQZBNB HSPVQTQZBNB TIFMMCJOCBTI TVEP<"-- "--

    /01"448%"--> TTIBVUIPSJ[FELFZT TTISTB'%"%'"%#/[B$ZD&GEMGKBTE&"R6+WTW,H)3.)E CPPUDNE FDIPSPPUQZBNBcDIQBTTXE
  52. /ZBI$MJ  (PͰ։ൃ͞Εͨ"1*ϥούʔίϚϯυ  ίϚϯυҰൃͰ7.Λىಈ  VTFSEBUBʹରԠ͍ͯ͠ΔͷͰ೚ҙͷઃఆ͕ىಈޙʹ
 ߦΘΕΔ  *1ΞυϨεઃఆΛࣗಈԽ

    VE[VSBOZBIDMJ 8SBQQFSPG/ZBIUIF8SBQQFSPG0QFO4UBDL OZBIJOTUBODFTUEFWOZBIa JDFOUPTOQZBNBUFTUQQZBNBQBTTa ŠOFUXPSLFYUOFUFYU JOUOZBIa GNTNBMMVTFSEBUBVTFSEBUBZNM
  53. 1FD  ઃఆϑΝΠϧʹج͖ͮෳ਺ͷ7.Λ
 Ұׅىಈɾఀࢭ  VTFSEBUBͷςϯϓϨʔτԽΛαϙʔτ QZBNBUFTU UFOBOUQFQBCP JNBHFDFOUPT@DIFG@QVQQFU qBWPSNTNBMM

    OFUXPSLT FUI CPPUQSPUPTUBUJD JQ@BEESFTT HBUFXBZ EOT TFDVSJUZ@HSPVQ EFGBVMU TTI UFNQMBUFT CBTFZBNM XFCTFSWFSZBNM
  54. )BDLT·ͱΊ  Ϣʔβʔ؅ཧΛূ੻Λ࢒ͭͭ͠
 ָʹʂʂ  ηΩϡϦςΟʔ؅ཧ΍Πϯελϯε ࡞੒ͷखؒΛίʔυͰղܾ

  55. ࠓ΍ͬͯΔ͜ͱ

  56. *1Λҙࣝ͠ͳ͍ ΠϯϑϥΛίʔυͰ ࡞Γ͖Δ

  57. Α͋͘Δ%/4γεςϜ -# -# %/4 %/4 %/4 WJQ SJQ SJQ SJQ

    SJQ SJQ
  58. “)BTIJ$PSQࣾͷϓϩμΫτ *(.1Λར༻͠ಉ͡άϧʔϓͷϝϯόʔͷ௥Ճ΍ ཭୤ΛΠϕϯτ௨஌͠ɺεΫϦϓτͳͲͷ ࣮ߦ͕Մೳ

  59. 4FSG TFSGNFNCFST MCEFWMPDBMBMJWFSPMFMC EOTEFWMPDBMBMJWFSPMFEOT EOTEFWMPDBMBMJWFSPMFEOT DBUBHFOUMPH BHFOU&WFOUNFNCFSKPJOEOTEFWMPDBMEOTSPMFEOT ಉ͡άϧʔϓʹॴଐ͍ͯ͠Δϗετ ৽͘͠ϝϯόʔ͕௥Ճ͞Εͨ

  60. ࣗಈԽ4UFQ $IFG 7. TFSGNFNCFSKPJO -#ϨγϐΛྲྀ͢ -# 7.ͷىಈͱಉ࣌ʹ
 ɹDMPVEJOJUͰTFSGΠϯετʔϧ Ϩγϐ͕ྲྀΕͯ-#ͷΠϯετʔϧ͕׬ྃ

  61. ࣗಈԽ4UFQ -# -# %/4 %/4 %/4 WJQ SJQ SJQ

  62. ࣗಈԽ4UFQ $IFG 7. EOTϨγϐΛྲྀ͢ %/4 Ϩγϐ͕ྲྀΕͯEOTͷΠϯετʔϧ͕׬ྃ -# TFSGͷNFNCFSKPJO %/4αʔϏεͷ7*1ʹKPJOͨ͠%/4Λ ɹϝϯόʔ௥Ճ

    7.ͷىಈͱಉ࣌ʹ
 ɹDMPVEJOJUͰTFSGΠϯετʔϧ TFSGNFNCFSKPJO
  63. ࣗಈԽ4UFQ -# -# %/4 %/4 %/4 WJQ SJQ SJQ SJQ

    SJQ SJQ
  64. ࣗಈԽ4UFQ $IFG 7. EOTϨγϐΛྲྀ͢ %/4 Ϩγϐ͕ྲྀΕͯEOTͷΠϯετʔϧ͕׬ྃ -# TFSGͷNFNCFSKPJO %/4αʔϏεͷ7*1ʹKPJOͨ͠%/4Λ ɹϝϯόʔ௥Ճ

    7.ͷىಈͱಉ࣌ʹ
 ɹDMPVEJOJUͰTFSGΠϯετʔϧ TFSGͷNFNCFSKPJO
  65. /BNJOPSJ  4FSG -WTͷϥΠϒϥϦ  αʔϏεͷϔϧενΣοΫ΋Ͱ͖Δ  ϝϯόʔͷ௥Ճ΍࡟আΛ4MBDL௨஌ #! /usr/bin/env

    ruby require 'rubygems' require 'naminori' Naminori::Notifier::Configure.instance.set({ webhook_url: "https://hooks.slack.com/services/XXXXXX", channel: "#pyama", user: "#naminori" }) service_options = { vip:"192.168.77.9" } case when Naminori::Serf.role?("dns") Naminori::Service.event("dns", "lvs", service_options) when Naminori::Serf.role?("lb") Naminori::Lb.health_check("dns", "lvs",service_options) end
  66. ·ͱΊ

  67. શମ·ͱΊ  ϓϥΠϕʔτΫϥ΢υΛαʔϏε͝ͱʹς φϯτ؅ཧ͠ӡ༻͍ͯ͠·͢  ߏ੒؅ཧ΍؂ࢹ͸ࣗಈԽ  ख͕͔͔ؒΔ͜ͱɺ؅ཧ͕ඞཁͳ͜ͱ͸ࣗ ෼ͨͪͰίʔυॻ͍ͯղܾ 

    αʔϏεΛҠߦ͢Δ͚ͩͰ͸ͳͯ͘ɺΫϥ ΢υΒ͍͜͠ͱ΋࢝Ίͯ·͢
  68. ͜͜Ͱঁੑਞ͔Β
 ࣭໰͕ࡴ౸͢Δ

  69. ͝ਗ਼ௌ͋Γ͕ͱ͏
 ͍͟͝·ͨ͠

  70. Ҡߦࣄྫ

  71. /ZBIͰಈ͍͍ͯΔαʔϏε ֤αʔϏεӶҙҾͬӽ͠த

  72. None
  73. 4UFQ Ҡߦݩ -# 1SPYZ 8&# 5IF*OUFSOFU

  74. 4UFQ Ҡߦݩ -# 1SPYZ 8&# -# 1SPYZ 8&# 5IF*OUFSOFU

  75. 4UFQ Ҡߦݩ -# 1SPYZ 8&# -# 1SPYZ 8&# 5IF*OUFSOFU

  76. ϜʔϜʔυϝΠϯ  ΠϯϑϥΛ͢΂ͯ$IFGͰίʔυԽ  յΕͨΒࣺͯͯɺ࡞Γ௚͢  -#ͷ%JSFDU3PVUJOHߏ੒͕
 ૊Ίͳ͍ʜ

  77. %3ߏ੒૊Ίͳ͍໰୊  /PWB$PNQVUF͸εςʔτϑϧʹ൑அ͠
 *OWBMJE1BDLFUΛഁغ͢Δ  5$1XBZϋϯυγΣΠΫ͕੒ཱ͠ͳ͘ͳͬͨ IPTU# IPTU" TZO TZO

    BDL BDL σʔλ௨৴ͷ։࢝
  78. DPNQVUF DPNQVUF %3ߏ੒૊Ίͳ͍໰୊ -# 1SPYZ TZO TZO TZO BDL TZO

    BDLΛฦͨ͠ͷ͸DPNQVUF DMJFOU
  79. DPNQVUF DPNQVUF %3ߏ੒૊Ίͳ͍໰୊ -# 1SPYZ BDL DMJFOU

  80. DPNQVUF DPNQVUF /"5ߏ੒ʹͨ͠ -# 1SPYZ TZO TZO TZO BDL DMJFOU

  81. ϜʔϜʔυϝΠϯҠߦࣄྫ·ͱΊ  Πϯϑϥ͸͢΂ͯ$IFGͰίʔυԽ  7.ͷσʔλ͸͢΂ͯ$PNQVUF OPEF ෺ཧϗετ ͷϩʔΧϧ
 σΟεΫͷͨΊɺյΕͨΒ࡞Γͳ͓ ͢

     -#ͷ%3ߏ੒͸૊Ίͳ͍