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

cgroupとLinux Capabilityの活用 / rcon and capcon internals #lxcjp

cgroupとLinux Capabilityの活用 / rcon and capcon internals #lxcjp

MATSUMOTO Ryosuke

April 23, 2016
Tweet

More Decks by MATSUMOTO Ryosuke

Other Decks in Technology

Transcript

  1. DHSPVQͱ-JOVY$BQBCJMJUZͷ׆༻
    GMOϖύϘגࣜձࣾ
    γχΞɾϓϦϯγύϧΤϯδχΞ
    MATSUMOTO, Ryosuke
    @matsumotory
    2016/04/23 ୈ9ճ ίϯςφܕԾ૝Խͷ৘ใަ׵ձˏ෱Ԭ
    SDPOBOEDBQDPO
    JOUFSOBMT

    View full-size slide

  2. ໨࣍
    ίϯςφཁૉٕज़
    SDPOJOUFSOBMT
    DBQDPOJOUFSOBMT
    ·ͱΊ

    View full-size slide

  3. ίϯςφཁૉٕज़

    View full-size slide

  4. ϓϩηε੍ޚٕज़
    DHSPVQ
    ϓϩηεάϧʔϓͷϦιʔε੍ݶɾִ཭
    SDPOΛ։ൃ
    -JOVYDBQBCJMJUZ
    εϨου୯Ґʹ੍ޚՄೳͳಛݖάϧʔϓ܈
    DBQDPOΛ։ൃ

    View full-size slide

  5. DHSPVQ
    ϓϩηεάϧʔϓͷϦιʔε੍ޚ
    $16ɺ*0ɺϝϞϦ౳
    DHSPVQGTʹΑΔ*'
    ϑΝΠϧϕʔεͷૢ࡞
    ୈճɹ-JOVYΧʔωϧͷίϯςφػೳʦʧᴷDHSPVQͱ͸ʁʢͦͷʣ
    SFGIUUQHJIZPKQBENJOTFSJBMMJOVY@DPOUBJOFST

    View full-size slide

  6. DHSPVQͷ׆༻ྫ
    NPE@NSVCZʹΑΔ"QBDIFͷϦιʔε੍ޚ
    8FCαʔό΁ͷϦΫΤετ୯Ґ
    ͜ͷυϝΠϯ܈͸$16Ҏ಺
    ͜ͷಈతίϯςϯπ͸$16
    ͜ͷಈతίϯςϯπ͸*0Λ.CQT
    ͜ͷಈతίϯςϯπ͸ಛఆͷ$16ͷίΞ
    SFGIUUQCMPHNBUTVNPUPSKQ Q

    View full-size slide

  7. -JOVY$BQBCJMJUZ

    View full-size slide

  8. ΞΫηε੍ޚϞσϧͷ෮श
    ೚ҙΞΫηε੍ޚʢ%"$ʣ
    ࣗ਎͕࡞ͬͨϦιʔε΁ͷΞΫηε͸ࣗ਎͕ܾఆ
    6/*9ͷඪ४తͳϞσϧ
    ڧ੍ΞΫηε੍ޚʢ."$

    ࣗ਎͕࡞ͬͨϦιʔεʹ׬શʹΞΫηεͰ͖ΔΘ
    ͚Ͱ͸ͳ͍ɻ؅ཧऀ͕ܾఆ
    4&-JOVYɺ50.0:0-JOVY

    View full-size slide

  9. -JOVYDBQBCJMJUZ
    ैདྷͷ֊૚ͷ%"$ݖݶϞσϧͷ֦ு
    εϨου୯Ґʹ੍ޚՄೳͳಛݖάϧʔϓ
    εϨου͸छྨͷDBQBCJMJUZTFUΛ࣋ͭ
    1FSNJUUFEɾ&⒎FDUJWFɾ*OIFSJUBCMF
    ͦΕΒͷ૊Έ߹ΘͤͰDBQCJMJUZͷݖݶΛ੍ޚ

    View full-size slide

  10. 1FSNJUUFEͱ&GGFDUJWF
    1FSNJUUFE͸ڐՄ
    &⒎FDUJWFͷηοτɾΞϯηοτ͕Մೳ
    1FSNJUUFEΛΞϯηοτ͢Δͱ໭Εͳ͍
    &⒎FDUJWF͸࣮ޮ
    ࣮ࡍͷݖݶՄ൱νΣοΫ͸&⒎FDUJWFΛݟΔ
    1FSNJUUFE͕͋Ε͹Ξϯηοτޙͷ࠶ηοτ͕Մೳ

    View full-size slide

  11. -JOVYDBQBCJMJUZ
    ໿άϧʔϓʹ෼ׂ͞Ε͍ͯΔ
    VJEɾHJEมߋͷಛݖ
    ಛݖϙʔτʢҎԼʣͷόΠϯυಛݖ
    DISPPUͷಛݖ
    SFCPPUͷಛݖͳͲͳͲ
    SFGIUUQTMJOVYKNPTEOKQIUNM-%1@NBOQBHFTNBODBQBCJMJUJFT
    IUNM

    View full-size slide

  12. $BQBCJMJUZͷ׆༻ྫ
    NPE@QSPDFTT@TFDVSJUZ
    "QBDIFIUUQEͷTV&9&$ͷεϨου൛
    ϓϩηε୯Ґͷݖݶ෼཭͔ΒεϨου୯Ґ΁
    ݖݶ෼཭ͷίετΛεϨουͷੜ੒ɾഁغʹ௿ݮ

    View full-size slide

  13. ΞΫηε੍ޚϞσϧͷࠓޙ
    ࠓ΋ͳ͓ೋ֊૚ͷݹయతͳݖݶϞσϧ
    ࢖͍΍͍͕ͦ͢ΕͰྑ͍ͷ͔ʁ
    ྫ͑͹ҰൠϢʔβ੍͕ޚͰ͖ͯɺࢠϓϩηεʹ౉࣌͢ʹ
    ੍ݶͯ͠౉͢ͱ͔΍Γ͍ͨʜ͋ΕͬͰ͖Δʁ
    աڈͷݚڀͰ͸΋ͬͱෳࡶͳݖݶϞσϧ͕͋ͬͨ
    04Ͱ΍ΕΔ͜ͱ͸ͲΜͲΜෳࡶʹͳ͍ͬͯΔ
    ৽ͨͳೋ֊૚Ҏ্ͷݖݶϞσϧΛݕ౼ͯ͠ΈΔ

    View full-size slide

  14. UIBOLTUP!SSSFFFZZZ

    View full-size slide

  15. ίϚϯυͷϦιʔε੍ޚ
    IUUQTHJUIVCDPNNBUTVNPUPSSDPO
    ࣮ߦ͍ͨ͠ίϚϯυͷϦιʔε੍ޚ
    ࣮ߦதͷϓϩηεͷϦιʔε੍ޚ
    $16ɺϝϞϦɺ*0ɺάϧʔϓԽ
    ϦιʔεมԽ͔ΒॲཧΛίʔϧόοΫՄೳ

    View full-size slide

  16. SDPOͷྑ͍ॴ
    ࣮ߦޙ΍ఀࢭޙʹDHSPVQͷΰϛ૟আ
    ࣮ߦ࣌ͷίϚϯυΛϫϯϥΠϯͰ੍ޚ
    DHSPVQ͕͋Ε͹࢖͑Δ
    MJCDHSPVQΛTUBUJDMJOL
    NSVCZͰϫϯόΠφϦʢHMJCDґଘʣ
    %PDLFS࢖֤ͬͯछHMJCDͷόΠφϦΛެ։

    View full-size slide

  17. ࢖͍Ͳ͜Ζͷྫ
    ΫϥΠΞϯτͰ-JOVY࢖ͬͯΔਓ
    ϒϥ΢β͸$16·Ͱ
    ϝʔϥʔॏ͍͔Β੍ݶͯ͠΍Ζ͏
    αʔόͰ-JOVY࢖͍ͬͯΔਓ
    ͜ͷϓϩάϥϜ͸*0੍ޚͭͭ҆͠શʹ
    ͔͔࣌ؒͬͯ΋ྑ͍ͷͰ$16཈͑ؾຯͰ

    View full-size slide

  18. DHSPVQT,FSOFM
    MJCDHSPVQ DHSPVQGT
    NSVCZDHSPVQNSVCZFWFOUGE
    SDPO
    NSVCZSDPO
    ϝϞϦίʔϧόοΫ
    ͷΈϑΝΠϧ*0Λར༻

    View full-size slide

  19. ϝϞϦίʔϧόοΫ
    DHSPVQͷϝϞϦΠϕϯτΛݕ஌
    ϝϞϦ੍ݶ஋΁ͷ౸ୡ΍0VUPG.FNPSZ
    FWFOUGEΛNSVCZFWFOUGEͱ࣮ͯ͠૷
    IUUQTHJUIVCDPNNBUTVNPUPSNSVCZFWFOUGE
    NSVCZSDPO
    3VCZϒϩοΫΛίʔϧόοΫՄೳ
    ϝϞϦ੍ݶ஋ͷ֦ு
    NSVCZFWFOUGEʹΑΔݕ஌ͱ௨஌
    IUUQTHJUIVCDPNNBUTVNPUPSNSVCZSDPO

    View full-size slide

  20. ೚ҙͷίϚϯυͷಛݖΛݶఆ
    ೚ҙͷίϚϯυΛ೚ҙͷϢʔβͰ
    DBQBCJMJUZΛ੍ޚ࣮ͭͭ͠ߦ͔ͨͬͨ͠
    ͕ɺͰ͖ͳ͔ͬͨʂ

    View full-size slide

  21. Ͱ͖ͳ͔ͬͨཧ༝
    FYFDWF࣌ʹDBQ͕શͯམͪΔ
    XSBQQFSπʔϧͳͷͰGPSLFYFDWF͸ඞਢ
    SPPUݖݶͩͱFWFDWFޙ΋Ҿ͖ܧ͙͕
    Ͱ΋ࠓճ͸೚ҙͷϢʔβͰ࣮ߦ͍ͨ͠
    ϑΝΠϧDBQΛઃఆ͢ΔͱҾ͖ܧ͙͕
    ೚ҙͷίϚϯυ͕ର৅ͳͷͰϑΝΠϧDBQ͸࿔Εͳ͍

    View full-size slide

  22. ิ଍ɿDBQͷҾ͖ܧ͗ϧʔϧ
    1 QFSNJUUFE
    1 JOIFSJUBCMF
    ' JOIFSJUBCMF

    c
    ' QFSNJUUFE
    DBQ@CTFU

    1 F⒎FDUJWF
    ' F⒎FDUJWF
    1 QFSNJUUFE

    1 JOIFSJUBCMF
    1 JOIFSJUBCMF

    1FYFDWF
    લͷεϨουͷέʔύϏϦςΟηοτͷ஋
    1`FYFDWF
    ޙͷεϨουͷέʔύϏϦςΟηοτͷ஋
    'ϑΝΠϧέʔύϏϦςΟηοτͷ஋
    DBQ@CTFUέʔύϏϦςΟό΢ϯσΟϯάηοτͷ஋

    View full-size slide

  23. SDPOBOEDBQDPOJOUFSOBMT
    DHSPVQTͱ-JOVYDBQBCJMJUZͷ׆༻
    ίϚϯυϥΠϯ͔Β׆༻͍ͨ͠
    SDPO͸Ͱ͖͚ͨͲDBQDPO͸ະ׬੒
    DHSPVQTͱDBQBCJMJUZͰϓϩηεΛ
    ߴ౓ʹ੍ޚͰ͖Δ

    View full-size slide

  24. ࠓޙ΍Γ͍ͨ͜ͱ
    7.ΛϓϩηεɺίϯςφΛεϨουͱݟཱͯΔ
    LFSOFM͕͋Δछͷڞ༗ϝϞϦͷΑ͏ͳ΋ͷ
    ͍͔ʹϓϩηεΛ଎͘ɾޮ཰ྑ͘GPSL
    ͢Δ͔
    ͍͔ʹεϨουΛ଎͘ɾ҆શʹ࡞Δ͔
    ͍͔ʹϓϩηεؒͷεέδϡʔϧ΍Ϧιʔε؅ཧΛ͢Δ͔
    ࠓޙ͸7.΍ίϯςφͷ࿈ܞ͕ࠓͰ͍͏04ͱͳΔੈք͕དྷΔ
    ͱࢥ͍ͬͯΔͷͰɺݹయతͳ04ͷػೳΛ͍͔ʹωοτϫʔΫ
    Λ௨ͨͦ͡Εʹஔ͖׵͍͔͑ͯ͘ʹ௅ઓ

    View full-size slide