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

Elasticsearch 勉強会 2/2

Kunihiko Kido
July 04, 2017
1.5k

Elasticsearch 勉強会 2/2

Kunihiko Kido

July 04, 2017
Tweet

Transcript

  1. &MBTUJDTFBSDIษڧձ̎

    View full-size slide

  2. ࣗݾ঺հ
    w ໦ށࠃ඙ʢ,VOJIJLP,JEPʣ
    w ϕϧτϥגࣜձࣾʢ7&-53"$PSQPSBUJPOʣ
    w $4޲͚ιϦϡʔγϣϯاըɾ։ൃ
    w ࣗવݴޠॲཧશจݕࡧΤϯδϯˍػցֶश

    View full-size slide

  3. "CPVU7&-53"
    :PVSTUPSZCFHJOTIFSF
    ISWFMUSBDPN

    View full-size slide

  4. w ࠓճͷ಺༰͸ɺՍۭͷݕࡧγφϦΦΛ΋ͱʹɺ&MBTUJDTFBSDIͷઃܭʹͭ
    ͍ͯઆ໌͠·͢ɻ౰ࢿྉͰ͸ɺ࿦ཧతͳΠϯσοΫεͷઃܭɺυΩϡϝϯ
    τઃܭɺΫΤϦઃܭΛத৺ʹղઆ͠·͢ɻ

    View full-size slide

  5. ݕࡧγφϦΦ࣮ߦ؀ڥ

    View full-size slide

  6. γφϦΦ࣮ߦ؀ڥͷೖख
    w ҎԼͷαΠτ͔ΒγφϦΦ࣮ߦ؀ڥΛೖखՄೳ
    w IUUQTHJUIVCDPN,VOJIJLP,JEPEPDLFSFMLNPWJFMFOT
    w ౰γεςϜΛ࣮ߦ͢Δʹ͸ɺ%PDLFS$PNQPTF͕ಈ࡞͢Δ؀ڥΛ༻ҙ͠
    ͍ͯͩ͘͞ɻ

    View full-size slide

  7. γεςϜ֓ཁ
    w .Z42-
    w &MBTUJDTFBSDI
    w -PHTUBTI .PWJF

    w -PHTUBTI 3BUJOH

    w ,JCBOB
    &MBTUJDTFBSDI
    .Z42-
    IUUQ
    UDQ
    UDQ
    EBUBCBTFNPWJFMFOT
    VTFSNPWJFMFOTQBTT
    -PHTUBTI .PWJF

    -PHTUBTI 3BUJOH

    )UUQ
    ,JCBOB

    View full-size slide

  8. γφϦΦ࣮ߦ؀ڥͷىಈͱఀࢭ
    w ίϯςφΛ࡞੒࣮ͯ͠ߦ
    w EPDLFSDPNQPTFVQE
    w ίϯςφͷҰཡΛදࣔ
    w EPDLFSDPNQPTFQT
    w αʔϏεͷϩάΛग़ྗ
    w EPDLFSDPNQPTFMPHT
    w ίϯςφΛఀࢭͯ͠࡟আ
    w EPDLFSDPNQPTFEPXO
    ˞ࢀߟɿIUUQTEPDTEPDLFSDPNDPNQPTFSFGFSFODF

    View full-size slide

  9. σʔληοτ

    View full-size slide

  10. %BUBTFUT
    w .PWJF-FOT
    w IUUQTHSPVQMFOTPSHEBUBTFUTNPWJFMFOT

    View full-size slide

  11. %BUBNPEFMT
    NPWJFT
    NPWJF*E
    UJUMF
    HFOSFT
    SBUJOHT
    VTFS*E
    NPWJF*E
    SBUJOH
    UJNFTUBNQ
    UBHT
    VTFS*E
    NPWJF*E
    UBH
    UJNFTUBNQ




    View full-size slide

  12. NPWJFTUBCMF
    NPWJF*E UJUMF HFOSFT
    5PZ4UPSZ
    "EWFOUVSFc"OJNBUJPOc$IJMESFOc$PNFEZc'BOUBTZ
    +VNBOKJ
    "EWFOUVSFc$IJMESFOc'BOUBTZ
    (SVNQJFS0ME.FO
    $PNFEZc3PNBODF

    View full-size slide

  13. UBHTUBCMF
    VTFS*E NPWJF*E 5BH UJNFTUBNQ
    TBOESBCPSJOHCVMMPDL
    EFOUJTU
    $BNCPEJB

    View full-size slide

  14. SBUJOHTUBCMF
    VTFS*E NPWJF*E SBUJOH UJNFTUBNQ



    View full-size slide

  15. *OEFYJOH
    .PWJF-FOT
    %BUBCBTF
    .PWJF-FOT
    *OEJDFT
    4&-&$5
    *OEFYJOH
    *OQVUEBUB
    0VUQVUEBUB
    1SFQSPDFTTJOH

    View full-size slide

  16. ݕࡧγφϦΦ

    View full-size slide

  17. ϜʔϏʔશจݕࡧ
    w ϜʔϏʔͷλΠτϧɺδϟϯϧ໊ɺλά໊Λର৅ʹશจݕࡧΛ࣮ݱ͢Δɻ
    w ݕࡧ݁Ռ͸ॏෳ͠ͳ͍ϜʔϏʔ୯ҐͰฦ٫͢Δɻ
    w ݕࡧ݁ՌͷϥϯΩϯά͸ɺείΞϦϯάॱɺٴͼλΠτϧͷ"4$**DPEF
    ॱ͕ରԠՄೳͳ͜ͱɻ

    View full-size slide

  18. *."(&
    4UBS8BST
    *."(&
    *."(&
    *."(&

    View full-size slide

  19. δϟϯϧφϏήʔγϣϯ
    w ݕࡧ݁ՌΛ΋ͱʹδϟϯϧφϏήʔγϣϯΛ࣮ݱ͢Δɻ
    w ϜʔϏʔશจݕࡧͷݕࡧ৚݅ΛࢦఆՄೳͳ͜ͱɻ
    w ݕࡧ݁Ռ͸δϟϯϧ໊Λݕࡧ݁Ռͷଟ͍ॱʹฦ٫ɻ
    w ֤δϟϯϧຖʹݕࡧ݁Ռ਺Λฦ٫͢Δɻ

    View full-size slide

  20. 3FMBUFE(FOSFT
    "EWFOUVSF
    "OJNBUJPO
    $IJMESFO`T
    $PNFEZ
    "DUJPO
    $SJNF













    View full-size slide

  21. ϜʔϏʔ၆ᛌݕࡧ
    w ϜʔϏʔશจݕࡧݕࡧͷݕࡧ݁ՌΛδϟϯϧຖʹදࣔ͢Δɻ
    w ϜʔϏʔશจݕࡧͷݕࡧ৚݅ΛࢦఆՄೳͳ͜ͱɻ
    w δϟϯϧ಺ͷϜʔϏʔݕࡧ݁Ռ͸είΞϦϯάॱɻ

    View full-size slide

  22. *."(&
    4UBS8BST
    *."(&
    *."(&
    'BOUBTZ
    $PNFEZ

    View full-size slide

  23. ύʔιφϥΠζυݕࡧ
    w ύʔιφϥΠζ͞ΕͨϜʔϏʔݕࡧΛ࣮ݱ͢Δɻ
    w ϜʔϏʔશจݕࡧͷݕࡧ৚݅ΛࢦఆՄೳͳ͜ͱɻ
    w ݕࡧΩʔϫʔυͷϚον౓ʹʹՃ͑ɺݕࡧର৅Ϣʔβʔͷᅂ޷ʹ͍ۙ݁Ռ
    ΄Ͳ্ҐʹදࣔͰ͖Δ͜ͱɻ
    w ͜͜Ͱ͸ɺݕࡧର৅ϢʔβʔͷߴධՁʢελʔҎ্ʣϜʔϏʔ܈ͷಛ௃
    Λද͢δϟϯϧϕετ̏ΛͦͷϢʔβʔͷᅂ޷ʢ޷͖ͳδϟϯϧʣΛද͢
    ͱఆٛ͢Δɻ

    View full-size slide

  24. *."(&
    4UBS8BST
    *."(&
    *."(&
    *."(&
    *."(&
    4UBS8BST
    *."(&
    *."(&
    *."(&
    6TFS" MJLF"OJNBUJPO$IJMESFO`T

    6TFS# MJLF$PNFEZ"EWFOUVSF

    4BNFLFZXPSET

    View full-size slide

  25. ΠϯσοΫεઃܭ

    View full-size slide

  26. ओͳΠϯσοΫε
    w ϜʔϏʔΠϯσοΫεʢNBTUFSNPWJFNPWJFTʣ
    w ϜʔϏʔධՁཤྺΠϯσοΫεʢFWFOUSBUJOH\ZZZZ^SBUJOHTʣ

    View full-size slide

  27. ϜʔϏʔΠϯσοΫε
    w NBTUFSNPWJFNPWJFT NPWJF

    w ϜʔϏʔશจݕࡧ༻
    w جຊతʹ͸αΠτӡӦऀ͕ͦͷσʔλΛϝϯςφϯε͢Δ͍ΘΏΔϚελʔ
    ܥͷσʔλͱ૝ఆɻ
    w σʔλྔɺߋ৽ස౓͸૝ఆ͠΍͍͢ɻ

    View full-size slide

  28. ઃܭͷϙΠϯτ
    w ΠϯσοΫε໊͸ϧʔϧ͕ద༻͠΍͍͢Α͏ʹύλʔϯԽ͢Δ
    w ݕࡧ༻ʹΤΠϦΞεΛఆٛ͢Δ
    w جຊతʹ͸̍ͭͷϦιʔεରͯ̍ͭ͠ͷΠϯσοΫεͰઃܭ
    w σʔλྔ͕ଟ͘ͳΔͱ༧૝͞ΕΔ৔߹͸ɺ͋Β͔͡Ίγϟʔυ਺Λ૿΍͢
    w ΠϯσοΫεΛෳ਺ʹ෼͚Δ৔߹͸ɺӡ༻ͷ͠΍͢͞Λߟྀ

    View full-size slide

  29. ϜʔϏʔධՁཤྺΠϯσοΫε
    w FWFOUSBUJOH\ZZZZ^SBUJOHT SBUJOH

    w Ϣʔβʔᅂ޷෼ੳ༻
    w ҰൠϢʔβʔͷΞΫγϣϯʹΑͬͯ஝ੵ͞ΕΔ͍ΘΏΔΠϕϯτܥͷσʔ
    λͱ૝ఆɻ
    w σʔλྔ΋ଟ͘ɺߋ৽ස౓΋ߴ͍ͱ૝ఆ͞ΕΔ͕ɺͦͷྔ͸૝ఆͮ͠Β͘
    ੍ޚ΋ͮ͠Β͍ɻ

    View full-size slide

  30. ઃܭͷϙΠϯτ
    w ΠϯσοΫε໊͸ϧʔϧ͕ద༻͠΍͍͢Α͏ʹύλʔϯԽ͢Δ
    w ݕࡧ༻ʹΤΠϦΞεΛఆٛ͢Δ
    w جຊతʹ͸೔෇Λ࢖ͬͯෳ਺ͷΠϯσοΫεͰઃܭ
    w ೥ผPS݄ผPS೔ผ

    View full-size slide

  31. υΩϡϝϯτઃܭ

    View full-size slide

  32. \
    HFOSFT<
    %SBNB
    >
    NPWJF@JE
    UJUMF2VJ[4IPX

    UBHT<
    3BMQI'JFOOFT
    >
    ^
    ϜʔϏʔυΩϡϝϯτ
    w υΩϡϝϯτʹϜʔϏʔʹͳΔΑ͏ʹઃܭɻ
    w %PDVNFOU*El\NPWJF@JE^z
    w ϜʔϏʔ͸ɺෳ਺ͷϜʔϏʔʹॴଐ͢Δɻ
    w ϜʔϏʔ͸ɺෳ਺ͷμά͕෇༩͞Ε͍ͯΔɻ

    View full-size slide

  33. ઃܭͷϙΠϯτ
    w ϑΟʔϧυ໊͸ϧʔϧΛద༻͠΍͍͢Α͏ʹ໋໊ن໿Λ༻ҙ
    w ϑϥάܥͷϑΟʔϧυ͸Θ͔Γ΍͍͢ϑΟʔϧυ໊ʹ͢Δɻ
    w ϑϥάܥͷϑΟʔϧυͷ஋͸ҙຯΘ͔Δ஋ʹม׵͢Δ

    View full-size slide

  34. \
    VTFS@JE
    HFOSFT<
    $PNFEZ
    %SBNB
    3PNBODF
    >
    NPWJF@JE
    SBUJOH
    UJNFTUBNQ
    ^
    ϜʔϏʔධՁཤྺυΩϡϝϯτ
    w υΩϡϝϯτʹධՁཤྺʹͳΔΑ͏ʹઃܭɻ
    w %PDVNFOU*El\VTFS@JE^\NPWJF@JE^
    \UJNFTUBNQ^z
    w ̍ධՁཤྺ͸ɺϜʔϏʔͱؔ࿈͢Δɻ
    w ̍ධՁཤྺʹରͯ̍͠ධՁ
    w ධՁ͸ʙ

    View full-size slide

  35. ΞφϥΠβʔઃܭ

    View full-size slide

  36. w ࠓճ͸σϑΥϧτͷ··Ͱ΋ཁ݅ΛຬͨͤΔͷͰઃܭ͠ͳ͍ɻ
    w ςΩετϑΟʔϧυͷΞφϥΠβʔ͸4UBOEBSE͕࢖༻͞ΕΔɻ
    w 4UBOEBSE"OBMZ[FS
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODF
    DVSSFOUBOBMZTJTTUBOEBSEBOBMZ[FSIUNM

    View full-size slide

  37. 4UBOEBSE"OBMZ[FS
    1045@BOBMZ[F
    \
    BOBMZ[FSTUBOEBSE
    lUFYU*/PX1SPOPVODF:PV$IVDLBOE-BSSZ

    ^

    ˣˣˣˣˣ

    View full-size slide

  38. ઃܭͷϙΠϯτ
    w ݴޠผʹಉ͡༻్ͷΞφϥΠβʔΛఆٛ͢Δ৔߹͸໊લ͕ಉ͡ʹͳΔΑ͏
    ʹઃܭ͢ΔʢϚοϐϯάఆٛΛݴޠڞ௨ʹ͢ΔͨΊʣ
    w ΠϯσοΫεଆͷΞφϥΠβʔΛઃܭ͠ɺඞཁʹԠͯ͡αʔνଆͷΞφϥ
    ΠβʔΛఆٛ͢Δ
    w γϊχϜࣙॻΛద༻͢Δεςʔδ͸ɺΠϯσοΫεଆ·ͨ͸αʔνଆͷ͍
    ͣΕ͔Ͱઃܭ͢Δ

    View full-size slide

  39. Ϛοϐϯάઃܭ

    View full-size slide

  40. w .PWJF*OEFY
    w ಛʹͳ͠ɻEFGBVMUͷ··ɻ
    w 3BUJOH*OEFY
    w 3BUJOHTBSFNBEFPOBTUBSTDBMF XJUIIBMGTUBSJODSFNFOUT TUBSTTUBST

    w 5JNFTUBNQTSFQSFTFOUTFDPOETTJODFNJEOJHIU$PPSEJOBUFE6OJWFSTBM5JNF 65$

    PG+BOVBSZ
    w ˞ࢀߟ'JFMEEBUBUZQFT
    ɿ
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFDVSSFOUNBQQJOH
    UZQFTIUNM

    View full-size slide

  41. .BQQJOHͷ֬ೝ
    w .PWJF*OEFY
    w (&5NPWJF@NBQQJOH
    w 3BUJOH*OEFY
    w (&5SBUJOH@NBQQJOH

    View full-size slide

  42. ઃܭͷϙΠϯτ
    w ΠϯσοΫεڞ௨ͷఆٛ͸ΠϯσοΫεςϯϓϨʔτͰಈతʹఆٛ͢Δ
    w ΠϯσοΫεݻ༗ͷఆٛ͸੩తʹతఆٛ͢Δ
    w ଟݴޠʹରԠ͢Δ৔߹͸ݴޠڞ௨ʹͳΔΑ͏ʹઃܭ͢Δʢൃߦ͢ΔΫΤϦ
    ͕ݴޠڞ௨ʹͳΔʣ

    View full-size slide

  43. ϜʔϏʔશจݕࡧ
    w (&5NPWJF@TFBSDI
    w 4JNQMF2VFSZ4USJOH
    \
    RVFSZ\
    TJNQMF@RVFSZ@TUSJOH\
    RVFSZTUBSXBST
    pFMET<UJUMF? UBHT HFOSFT?>
    EFGBVMU@PQFSBUPSBOE
    ^
    ^
    TPSU<@TDPSF>
    ^

    View full-size slide

  44. ΫΤϦΛมߋͯ͠ࢼͯ͠ΈΑ͏
    w ৭ʑͳΩʔϫʔυͰݕࡧͯ͠ΈΔɻ
    w શจݕࡧͷϑΟʔϧυͷॏΈΛมߋͯ͠είΞΛ֬ೝ
    w શจݕࡧʹՃ͑ɺ"/%৚݅ͰλάͷߜΓࠐΈΛ௥Ճ

    View full-size slide

  45. ࢀߟ63-
    w 'VMMUFYURVFSJFT
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFDVSSFOUGVMMUFYU
    RVFSJFTIUNM
    w 5FSNMFWFMRVFSJFT
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFDVSSFOUUFSNMFWFM
    RVFSJFTIUNM
    w $PNQPVOERVFSJFT
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFDVSSFOUDPNQPVOE
    RVFSJFTIUNM

    View full-size slide

  46. δϟϯϧφϏήʔγϣϯ
    w (&5NPWJF@TFBSDI
    w 5FSNT"HHSFHBUJPO
    w LFZXPSE OPUBOBMZ[FEpFME

    w 4J[F
    \
    TJ[F
    RVFSZ\
    TJNQMF@RVFSZ@TUSJOH\
    RVFSZTUBSXBST
    pFMET<UJUMF? UBHT HFOSFT?>
    EFGBVMU@PQFSBUPSBOE
    ^
    ^
    BHHT\
    HFOSFT\
    UFSNT\
    pFMEHFOSFTLFZXPSE
    ^
    ^
    ^
    ^

    View full-size slide

  47. ΫΤϦΛมߋͯ͠ࢼͯ͠ΈΑ͏
    w ৭ʑͳΩʔϫʔυͰݕࡧͯ͠ΈΔɻ
    w ूܭ݁ՌͷฒͼॱΛมߋͯ͠ΈΔ
    w δϟϯϧͱλάΛଟஈͰूܭͯ͠ΈΔ
    w ूܭ݁Ռ͔Β೚ҙͷ݁ՌΛআ֎ͯ͠ΈΔ
    w FUD

    View full-size slide

  48. ࢀߟ63-
    w 5FSNT"HHSFHBUJPO
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODF
    DVSSFOUTFBSDIBHHSFHBUJPOTCVDLFUUFSNTBHHSFHBUJPOIUNM

    View full-size slide

  49. ϜʔϏʔ၆ᛌݕࡧ
    w (&5NPWJF@TFBSDI
    w 5FSNT"HHSFHBUJPO
    w 5PQ)JUT"HHSFHBUJPO
    w 4J[F
    \
    TJ[F
    RVFSZ\
    TJNQMF@RVFSZ@TUSJOH\
    RVFSZTUBSXBST
    pFMET<UJUMF? UBHT HFOSFT?>
    EFGBVMU@PQFSBUPSBOE
    ^
    ^
    BHHT\
    HFOSFT\
    UFSNT\
    pFMEHFOSFTLFZXPSE
    ^
    BHHT\
    UPQ@HFOSF@IJUT\
    UPQ@IJUT\
    TPSU<
    @TDPSF
    >
    @TPVSDF\
    JODMVEF<UJUMF UBHT HFOSFT>
    ^
    TJ[F
    ^
    ^
    ^
    ^
    ^

    View full-size slide

  50. ΫΤϦΛมߋͯ͠ࢼͯ͠ΈΑ͏
    w ৭ʑͳΩʔϫʔυͰݕࡧͯ͠ΈΔɻ
    w δϟϯϧͷฒͼॱΛมߋͯ͠ΈΔɻ
    w λάผʹݕࡧ݁ՌΛάϧʔϐϯάͯ͠ΈΔ

    View full-size slide

  51. ύʔιφϥΠζυݕࡧ
    ʢϢʔβʔᅂ޷ͷ෼ੳʣ
    w 1045SBUJOH@TFBSDI
    w 4JHOJpDBOU5FSNT"HHSFHBUJPO
    w 4J[F
    \
    TJ[F
    RVFSZ\
    TJNQMF@RVFSZ@TUSJOH\
    RVFSZTUBSXBST
    pFMET<UJUMF? UBHT HFOSFT?>
    EFGBVMU@PQFSBUPSBOE
    ^
    ^
    BHHT\
    HFOSFT\
    UFSNT\
    pFMEHFOSFTLFZXPSE
    ^
    BHHT\
    UPQ@HFOSF@IJUT\
    UPQ@IJUT\
    TPSU<@TDPSF>
    @TPVSDF\
    JODMVEF<UJUMF UBHT HFOSFT>
    ^
    TJ[F
    ^
    ^
    ^
    ^
    ^
    ^

    View full-size slide

  52. ΫΤϦΛมߋͯ͠ࢼͯ͠ΈΑ͏
    w ֤छύϥϝʔλΛมߋͯ݁͠Ռͷҧ͍Λ֬ೝͯ͠ΈΔ
    w 5FSNT"HHSFHBUJPOʹมߋͯ݁͠Ռͷҧ͍Λ֬ೝͯ͠ΈΔ
    w FUD

    View full-size slide

  53. ࢀߟ63-
    w 4JHOJpDBOU5FSNT"HHSFHBUJPO
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODF
    DVSSFOUTFBSDIBHHSFHBUJPOTCVDLFUTJHOJpDBOUUFSNT
    BHHSFHBUJPOIUNM

    View full-size slide

  54. ύʔιφϥΠζυݕࡧ
    ʢϢʔβʔᅂ޷ΛՃຯͨ͠ݕࡧʣ
    w 1045NPWJF@TFBSDI
    w 'VODUJPO4DPSF2VFSZ
    \
    RVFSZ\
    GVODUJPO@TDPSF\
    RVFSZ\
    TJNQMF@RVFSZ@TUSJOH\
    RVFSZTUBSXBST
    pFMET<UJUMF? UBHT HFOSFT?>
    EFGBVMU@PQFSBUPSBOE
    ^
    ^
    GVODUJPOT<
    \
    pMUFS\NBUDI\HFOSFT5IF
    a^^
    XFJHIU
    ^
    \
    pMUFS\NBUDI\HFOSFT3PNBODF^^
    XFJHIU
    ^
    \
    pMUFS\NBUDI\HFOSFT$PNFEZ^^
    XFJHIU
    ^
    >
    TDPSF@NPEFTVN
    CPPTU@NPEFNVMUJQMZ
    ^
    ^
    ^

    View full-size slide

  55. ΫΤϦΛมߋͯ͠ࢼͯ͠ΈΑ͏
    w ֤छύϥϝʔλΛมߋͯ݁͠Ռͷҧ͍Λ֬ೝͯ͠ΈΔ
    w FUD

    View full-size slide

  56. ࢀߟ63-
    w 'VODUJPO4DPSF2VFSZ
    w IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODF
    DVSSFOURVFSZETMGVODUJPOTDPSFRVFSZIUNM

    View full-size slide