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

pixiv のインフラに serverspec を導入した話 #石狩DC

pixiv のインフラに serverspec を導入した話 #石狩DC

pixiv のインフラに serverspec を導入した話

Kaneko Tatsuya

November 23, 2013
Tweet

More Decks by Kaneko Tatsuya

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w DBUBUTVZ w ݄ʹϐΫγϒגࣜձࣾʹ৽ଔೖࣾ w ʰϐΫγϒגࣜձࣾʹೖࣾ͠·ͨ͠ʱΤϯτϦʔΛ͸ͯͳϒϩάʹॻ ͖·ͨ͠ w ͸ͯϒ਺͸ͯͳελʔ΋ͨ͘͞Μ෇͍ͯ࠷ߴʂ

    w ϐΫγϒ৽ถΠϯϑϥΤϯδχΞʢࣗশʣ w ͸ͯͳΠϯλʔϯͰ͓ੈ࿩ʹͳΓ·ͨ͠ʂ w ͘͞Βͷ714ʹ೥΄Ͳ͓ੈ࿩ʹͳ͍ͬͯ·͢ʂʢݱࡏਐߦܗʣ  
  2. TFSWFSTQFDಛ௃ w 3VCZϕʔεͷ%4- w SBLFͱSTQFDΛ࢖͍ͬͯΔ w HFNJOTUBMMTFSWFSTQFD w جຊతʹίϚϯυͷग़ྗΛݟ͍ͯΔ͚ͩ w

    04ʹΑͬͯଧͭίϚϯυΛTFSWFSTQFDଆͰ੾Γ෼͚Δ w TTIܦ༝ͰϗετϚγϯ͔ΒήετϚγϯͷςετ΋ग़དྷΔ  
  3. TFSWFSTQFDίʔυྫʢ%FCJBOͷ৔߹ʣ • dpkg -s ntp && ! dpkg -s ntp

    | grep -E '^Status: .+ not-installed$’ • ls /etc/rc3.d/ | grep -- nntp || grep 'start on' /etc/init/ntp.conf • ps aux | grep -w -- ntp | grep -qv grep   # ntp describe package('ntp') do it { should be_installed } end ! describe service('ntp') do it { should be_enabled } it { should be_running } end
  4. TFSWFSTQFDʹϓϧϦΫ w TFSWFSTQFDʹ͸HFNOQNQFDMQJQʹΠϯετʔϧ͞Ε ͍ͯΔ͔֬ೝ͢Δػೳ͕͋Δ w ͔͠͠QFBSDQBOʹΠϯετʔϧ͞Ε͍ͯΔ͔֬ೝ͢Δػ ೳ͸ͳ͍ͷͰػೳΛ௥Ճͯ͠ϓϧϦΫ w Ϛʔδ͞Εͨ w

    ͔͠͠DQBOʹؔͯ͠͸ࣄલʹDQBOͷઃఆ͕ͳ͞Εͯ ͍ͳ͍ͱ࣮ߦͰ͖ͳ͍ͷͰ$*Խ͸ແཧ w &YU6UJMT*OTUBMMFEΛ࢖͏ܗͷํ͕ྑͦ͞͏͕ͩɼDQBO Ҏ֎ͰೖΕͯ΋௨ΔͷͰอཹத  
  5. +FOLJOT w +FOLJOTଆʹԿߦ΋εΫϦϓτΛॻ͖ͨ͘ͳ͍ w +FOLJOTଆ͸γΣϧεΫϦϓτΛ࣮ߦ͢Δ͚ͩ export WORKSPACE! bash -x ${WORKSPACE}/setup_init/jenkins.sh!

    w γΣϧεΫϦϓτࣗମ͸όʔδϣϯ؅ཧ͢Δ w Ծ૝ϚγϯΛىಈͯ͠ɼ࣮ࡍʹBQUJUVEFJOTUBMMͳͲΛ࣮ߦ͢ Δඞཁ͕͋ΔͨΊ͔ͳΓֻ͕͔࣌ؒΔʢʙ෼ఔ౓ʣ w खݩͰ࣮ߦ͢Δͷ͸ݱ࣮తͰͳ͍ͷͰ+FOLJOTʹ·͔ͤΔ