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

5years-history-of-heteml

 5years-history-of-heteml

運用しているヘテムルでのサービス改善の歴史

Shinya Tsunematsu

November 12, 2013
Tweet

More Decks by Shinya Tsunematsu

Other Decks in Technology

Transcript

  1. Archerظ ✤ Pluggable! ✤ Archer::Plugin::RoleLoader! ✤ roles.yaml! ✤ ࢦఆͨ͠ϩʔϧʹ! ✤

    ίϚϯυ࣮ߦ! ✤ ϑΝΠϧσϓϩΠ …! ! web:! - web001.heteml.lan! - web002.heteml.lan! mail:! - mail001.heteml.lan! - mail002.heteml.lan! - mail003.heteml.lan! ! …
  2. ࣗ࡞πʔϧheteloyظ ✤ /var/lib/puppet/data/ ͕ PuppetϦϙδτϦͱͯ͋͠Δ! ✤ /var/lib/puppet/data/modules/web/files/etc/httpd/httpd.conf Λ! ✤ webϩʔϧʢલड़ͷroles.yaml)

    ͷϗετʹ഑෍͠! ✤ Apache ͷ configtest ͯ͠ OK ͳ৔߹͚ͩ restart ɺNG ͳ৔߹͸ϑΝΠϧϩʔϧόο Ϋ sudo heteloy.pl --role web \! --dist /etc/httpd/httpd.conf \! --mode 644 \! --exec ‘service httpd configtest’ \! --exec ‘service httpd restart’!
  3. ࣗ࡞πʔϧheteloyظ ✤ Α࣮͘ߦ͢ΔλεΫ͸λεΫΛyamlܗࣜʹdump! ✤ Ҏ߱͸ͦͷyamlΛࢦఆͯ͠ಉ͡ॲཧΛ࣮ߦՄೳ sudo heteloy.pl --role web \!

    ! --dist /etc/httpd/httpd.conf \! --mode 644 \! --exec ‘service httpd configtest’ \! --exec ‘service httpd restart’ \! --configdump > httpd_task.yaml! sudo heteloy.pl --configloada httpd_task.yaml!
  4. Cobbler ✤ ϗετ௥Ճ࣌͸ɺ͜ͷॲཧޙαʔόΛىಈ͢ΔͱOS ͕Πϯετʔϧ͞ΕΔ ʢωοτϫʔΫ෦෼ׂѪʣ cobbler system add \! --name

    web001.heteml.lan \! --hostname web001.heteml.lan \! --profile CentOS6.4-x86_64 \! --kopts “ksdevide=XX:XX:XX:XX:XX syslog=192.168.X.X” \! --kickstart /var/lib/cobbler/kickstarts/CentOS6-base.ks! ! cobbler sync
  5. ؂ࢹઃఆͷࣗಈੜ੒ ✤ Nagios! ✤ munin! ✤ roles.yaml Λ΋ͱʹ conf Λࣗಈੜ੒͢Δ!

    ✤ શαʔόڞ௨ͷ؂ࢹ (σΟεΫI/O, L/A)! ✤ ϩʔϧݻ༗ͷ؂ࢹ (webͩͬͨΒHTTPૄ௨౳)! ✤ ϗετݻ༗ͷઃఆ (ಛఆαʔό͸αʔό্Ͱύϥϝʔλ্ॻ͖ʣ
  6. खॱΛςϯϓϨʔτԽ export OLDHOST=<%= @config['src1_hostname'] %>! export NEWHOST=<%= @config['dst_lan_ip'] %>! rsync

    -rlptDv /data/backup/heteml/$OLDHOST/path/from/ $NEWHOST::data_to/ src1_hostname : web001! src1_lan_ip : 192.168.1.10! ! dst_hostname : web002! dst_lan_ip : 192.168.1.11!
  7. खॱΛςϯϓϨʔτԽ genecon -t README.md -c config.yaml > web001maintenance.md export OLDHOST=web001!

    export NEWHOST=192.168.1.11! rsync -rlptDv /data/backup/heteml/$OLDHOST/path/from/ $NEWHOST::data_to/ ✤ genecon https://github.com/glidenote/genecon