ãã®è¨äºã¯ Mackerel Advent Calendar 2015 ã®24æ¥ç®ã®è¨äºã§ãã ååã¯ãid:hitode909 ã«ãã 三度の飯より監視と通知!Mackerelで自分の心拍数を監視しよう - hitode909の日記 ã§ããã
ä»åã¯ãMackerel APIãç¨ãã¦Serverspecã«ãããµã¼ãæ§æãã¹ããå®éç¨åãã話ãç´¹ä»ãã¾ãã Serverspecåä½ã§ã¯æã®å±ããªããããã¨ãããMackerelã§ãµãã¼ãããã¨ããããã¤ã³ãã§ãã Mackerelã¯ãã¡ããã§ãããä»ã®ãµã¼ã管çãã¼ã«ã«ãéç¨ããæ±ç¨çãªè©±ã«ãªãããã«å¿ããã¦ãã¾ãã
Serverspecå°å ¥ã®èæ¯
10å¹´åä½ã§é·æéç¨ãã¦ãããµã¼ãã¹ãããã¤ãéç¨ãã¦ããã¨ãå¤ããµã¼ãã¹ã®ãµã¼ãã¯æä½æ¥ã§ä½ããã¦ããããæ§æ管çãã¼ã«ã§éä¸ã¾ã§ä½ã£ã¦æ®ãã¯æä½æ¥ã§ä½ããã¦ãããããã¨ãããã¨ã¯ã©ããã¦ãããã¾ãã ãã¼ãã¦ã§ã¢ã®èç¨å¹´æ°ããã£ã¹ã¯å®¹éãæºæ¯ã«ãªããµã¤ã¯ã«ããµã¼ãã¹ã®å¯¿å½ããçãããããããã®æä½ããµã¼ããã©ãã«ãå¼ã£è¶ãå¿ è¦ãããã¾ãã å ãæä½æ¥ãªã®ã§ãChefãAnsibleã§ä¸ããç«ã¦ç´ããã¨ãã§ãã¾ããã ãããã£ã¦ããããã®ãµã¼ããããã°ã£ã¦ä½ããªãããããä»®æ³ãã¹ãã§ããã°ããªã¥ã¼ã ã®å 容ãã³ãã¼ãã¦å¥ã®ç©çãã¹ãä¸ã§èµ·åãããããªãªãã¬ã¼ã·ã§ã³ãããªãé »ç¹ã«ãã£ã¦ãã¾ãã ã¬ã·ããæ°ããæ¸ããªãããã¨ãå½ç¶ããã¾ããããããªãã®æéãããããããã³ãã¼ã§æ¸ã¾ããã¨ãå¤ãã§ãã å¥ãµããããã¸ã®ä½ãç´ããã³ãã¼ã§ããã°ãIPã¢ãã¬ã¹ãå¤ãããã¨ãå½ç¶ããã¾ãã ã³ãã¼ã®ã¾ã¾ã§ã¯ã¾ããè¨å®ãç½®æã¹ã¯ãªããã§æ¸ãå¤ããããã¾ãã ãã¾ã«æ¸ãæãå¿ãã¦ããããã¹ã¯ãªããããããããããã¨ããµã¼ãã¹ã¤ã³ããã¨ãã«é害ã«ã¤ãªãããã¨ãããã¾ãã
ä¸æ¹ã§ãæ¯è¼çæ°ããã®ãµã¼ãã¹ã®ãµã¼ããã¤ã¾ãChefã§ä¸çºã§ãµã¼ãã¹ã¤ã³å¯è½ãªç¶æ ã®ãµã¼ããä½ããç°å¢ããã£ãã¨ãã¦ãã念ã®ããè¨å®ãã¡ã¤ã«ã確èªãããããã¼ã¸ã§ã³ã確ãããããAWSã§ããã°AZãæ£ãããEIPãã¤ãã¦ãããã¨ããããã念ã®ããæä½æ¥ã§ç¢ºãããããããã¨ããã¯ãããã¾ãã ç¹ã«ä»ã®ã¡ã³ãã¼ãä½ã£ããµã¼ãã¨åããã®ãæ§ç¯ããã¨ãã¯æ éã«ãªãã¾ãã Chefã®cookbookã¯çµ¶ããå¤æ´ãå ãããã¦ãããããæ°ããä¸ãããµã¼ããæ§ç¯ããã¨ãã«ãæ¢åã®ãµã¼ãã¨åããã®ãã§ããããä¿è¨¼ããªãããã§ãã
ã¡ããã©ä»é± id:moznion ã じこはおこるさ - 職質アンチパターン ã¨ããè¨äºãæ¸ãã¦ãã¾ããã
äºæ ããã¯å¦ç¿ããã¹ãã§ï¼å¦ç¿ããçµæåããããªãã¹ãé輪éèµ·ãããªããªãã°æã ã¯ãã®äºæ ã®å¯¾å¿ã«æéãåããããã¨ãç¡ããªã£ã¦ï¼ãã£ã¨çç£çãªæ´»åã«å¾äºãããã¨ãã§ããããã«ãªãã¨æãï¼å¦ç¿ã¯å°ãï¼
ããã¯ãããã - è·è³ªã¢ã³ããã¿ã¼ã³
ã¨ã«ãããªãã¬ã¼ã·ã§ã³ãã¹ã§äºæ ãèµ·ãããããªããããã©ãã«ããã¦ãµã¼ãæå ¥åã«äººéããã§ãã¯ãã¦ããé¨åã ãã§ãèªååãããã¨æã£ã¦ãã¾ããã èªååãã¤ã¾ãã³ã¼ãã«ãããã¨ã«ãããéå»ã®ãã¹ã®èç©ãæ°ããã¡ã³ãã¼ã§ãã£ã¦ãå³å©ç¨ã§ãã¾ãã
ããã§ãServerspecã§ãã
Serverspec
Serverspecã¨ã¯ããµã¼ãã®ç¶æ ãã³ã¼ãã«ããèªåçã«ãã¹ãããããã®ãã¼ã«ã§ãããRuby製ã®ãã¹ããã¬ã¼ã ã¯ã¼ã¯ã§ããRspecããã¼ã¹ã«ãã¦ãã¾ãã
å®®ä¸åè¼èãServerspecããªã©ã¤ãªã¼ã¸ã£ãã³ã2015å¹´ãp3
以åããServerspecã使ãããã¨æã£ã¦ã¯ãã¾ããã Serverspecã¨ããã°ããã¹ãé§åã¤ã³ãã©ãã¤ã³ãã©CIã¨ããè¨èã«ä»£è¡¨ãããããã«ãã¡ããã©ã¢ããªã±ã¼ã·ã§ã³ã§ç¶ç¶çã«ãã¹ããåããããªæ°æã¡ã§ãã¤ã³ãã©ã³ã¼ãã®ãã¹ããåãã¨ããå°è±¡ã§ããã å®éãæ¸ç±http://www.oreilly.co.jp/books/9784873117096/ ã«ã¯ãServerspecã®æ¬è³ªã¯ã¤ã³ãã©ã³ã¼ãã®ãªãã¡ã¯ã¿ãªã³ã°ãéçºã®ä¿é²ã§ããã¨æ¸ããã¦ãã¾ãã
ããã¾ã§ãServerspecã®æ¬è³ªã¯ãããã¹ãé§åã«ãã£ã¦ãã¤ã³ãã©ã³ã¼ãã®ãªãã¡ã¯ã¿ãªã³ã°ãéçºãä¿é²ããããã¨ã§ãã
å®®ä¸åè¼èãServerspecããªã©ã¤ãªã¼ã¸ã£ãã³ã2015å¹´ãp6
å°å ¥ãããã¨æããããã¤ã³ãã©CIãå§ãããã¨æã£ãã¨ããChefã®ãã¼ã«æ°ãããã¯ã«ãªããã¨ã«æããããã¾ããã Chefã®ãã¼ã«æ°ã¯ä»ç¾å¨è»½ã200ãè¶ ãã¦ãããããã«ä»å¾å以ä¸ã®ãã¼ã«æ°ã«ãªãå¯è½æ§ãããã¾ãã
Serverspecã¯æ§ç¯å¾ã®ãµã¼ãããã¹ããã¦ãªãã¬ã¼ã·ã§ã³ãã¹ãé²ããã¨ã主ç®çã§ã¯ãªãããããã¾ããã ããããServerspec以ä¸ã«ä»åã®åé¡è§£æ±ºã«æé©ãªãã¼ã«ãä»ã«ç¥ããªããããæ¡ç¨ãããã¨ã«ãã¾ããã ãã¹ããåãåºç¤ã誰ããæ´ãã¦ããã°ããã®ä¸ã«ä¹ã£ãã£ã¦ããã¹ããæ¸ãã¦ãããã¨ã«ã¯ãã»ã©å°ãã¾ããã åºæ¬çãªRubyã®æ§æãæ¸ããã°åé¡ãªãããã¨èãã¾ããã
æ¬å½ã®ãã¨ãè¨ãã¨Rubyã¨ãããRspecã¯ãRubyã主è¨èªã§ãªããã¼ã ã§ããããã¤ã³ãã©ã®ãã¹ãã³ã¼ããæ¸ãããã ãã«ãã¦ã¯å¦ç¿ã³ã¹ããé«ãããã¨æãã¦ãã¾ãã ãããªã«ããã°ã£ã¦ãã¹ããæ¸ããããªãã¨ããã®ãæ¬é³ãªã®ã§ãç¶æ ã®è¡¨ç¾åã¿ãããªãã®ããã¹ãã®çµæã®ã¬ãã¼ãã£ã³ã°ã«ã¯ããã»ã©èå³ãããã¾ããã RSpecã«ã¤ãã¦ãæ¸ç±Serverspecã«ä»¥ä¸ã®ãããªè¨åãããã¾ãã
RSpecã¯ãè¨æ³ã®ããªã¨ã¼ã·ã§ã³ãæ©è½ãå¤ãããã¼ã¸ã§ã³éã®å·®ç°ã大ãããããæ¬è³ªçã§ã¯ãªããã¨ã«æéãå²ããããªãã¨ããã±ã¼ã¹ã§ã¯ããã¾ãé©åãªãã¼ã«ã ã¨ã¯è¨ãã¾ããï¼èªåã§é¸æãã¦ããã¦ããè¨ãã®ãä½ã§ããï¼ã ã¨ã¯è¨ããServerspecã§ãã¹ãã³ã¼ããæ¸ãã«ããã£ã¦ã¯ãRSpecã®æ©è½ãè¨æ³ããã«ã«è¦ãã¦æ´»ç¨ããå¿ è¦ã¯ããã¾ããã
å®®ä¸åè¼èãServerspecããªã©ã¤ãªã¼ã¸ã£ãã³ã2015å¹´ãp30
å®éãRSpecã«ã¤ãã¦ããã»ã©ç¥ããã¨ããå ¬å¼ããã¥ã¡ã³ã Serverspec - Resource Types ãçºããªãããååæ¸ãã¦ãã¾ãã¨æãã¾ãã
ä¸æ¹ã§ãChefãItamaeãããã§ãããRuby ã§æ¸ããã¨ãããã¨ã¯ã¡ãªããã®ä¸ã¤ã§ãã è¦ã¯ãªãã§ãã§ãããããä»ã®ãã¼ã«ã¨ãé£æºããããã¨ããã®ã¯é常ã«éè¦ã§ãã
Serverspec à Mackerel
Serverspecã«ã¤ãã¦ã¯ãä»ã«ããã¹ãæ¹éããInfratasterãawspecãªã©ã®Serverspec inspiredãªãã¼ã«ã¨ã®çµã¿åããæ¹ãªã©ã®è©±é¡ãããã¾ãããä»åã¯ããµã¼ã管çãã¼ã«ã§ããMakcerelã¨ã®çµã¿åããã«ã¤ãã¦ç´¹ä»ãã¾ãã
ãã¼ã«åä½ã§specãæ¸ã
Serverspecã®ããã©ã«ãã¯ããã¹ããã¨ã«ãã£ã¬ã¯ããªãã¤ãããããªã¬ã¤ã¢ã¦ãã«ãªãã¾ãã å ã»ã©ãChefã®ãã¼ã«æ°ã200ãè¶ ããã¨æ¸ãã¾ããã å½ç¶ããã¹ããã¨ã«specãæ¸ãã¦ããããæ¹ã«ã¯éçãããããããã¼ã«ãã¨ã«specãæ¸ããããªãã¾ãã
id:deeeet ããã® デプロイ自動化とServerspec | SOTA ã«æ¸ããã¦ããéç¨ã«ããã¨ããã¹ãã¨ãã¼ã«ã®æ å ±ãéçã«å®ç¾©ãããã¡ã¤ã«ã使ãããã§ããï¼ä»ã§ã¯éãããããã¾ããï¼
ãµã¼ãã¼ã®æ°ãå¤ãã¨ãã¹ããã¨ã«ãã£ã¬ã¯ããªãæºåããServerspecããã©ã«ãã®ããæ¹ã§ã¯éçãããï¼ããããå ´åã¯ï¼ãã¼ã«æ¯ï¼ã¢ã¸ã¥ã¼ã«æ¯ã«ã«specãã¾ã¨ãï¼ãã¹ãã¨ãã®ãã¼ã«æ å ±ãå¥ãã¡ã¤ã«ï¼JSONå½¢å¼ãªã©ï¼ã§æºåãï¼ãããèªã¿è¾¼ã¿Rakeã¿ã¹ã¯ãå®ç¾©ããã®ãè¯ãï¼ ä»ã®ãã¼ã ã§ã¯ãããããã¹ãã¨ãã®ãã¼ã«ã®ãªã¹ããæºåãããããã¨ã«Chefãå®è¡ããã¨ããéç¨ããã£ãã®ã§ï¼ãã®ãªã¹ãããã®ã¾ã¾å©ç¨ãããã¨ã«ããï¼
http://deeeet.com/writing/2015/03/17/serverspec-for-automation/
Serverspec - Advanced Tips ã«ãããHow to share Serverspec tests among hostsãã¨ããé ç®ãããããã¼ã«ã®ãããªã°ã«ã¼ããã¨ã«specãæ¸ãæ§æãç´¹ä»ããã¦ãã¾ãã åè ã®å ´åãChefã¨å ±æã§ããã®ã¯ããããã§ãããServerspecã«éãããã¼ã«ãå°å ¥ãããã³ã«ããã¹ãæ å ±ããã¡ãã¡ã«æ¸ãã¯ãã«ãªããã¨ã¯å¾ã ã«ãã¦ããã¾ãã ããã¦ããã¹ãã®è¿½å ã»åé¤ãããã°ããããã®ãã¹ãæ å ±ãæ¸ãå¤ãã¦ã¾ãããã¨ã«ãªãã¾ãã ãã®ãããªéç¨ã¯ãç¹ã«ãã¹ããã©ãã©ãæ¨ã¦ã¦æ°ãããã¹ãããã¦ããããªImmutable Infrastructureçãªéç¨ã«ã¯ãã¾ã沿ãã¾ããã
ããã§ãMackerelã§ã¯APIãç¨ãã¦ããã¹ãæ å ±ãä¸å 管çãããã¨ããææ³ãæ¨å¥¨ãã¦ãã¾ãã Serverspecã®å ´åã¯ããã¹ãåãä¸ããããã¨ãMackerel APIãå©ãã¦ãã¹ãæ å ±ãå¼ãããµã¼ãã¹ã¨ãã¼ã«ãã対å¿ããspecãã¡ã¤ã«ã決ã¾ãã¨ãããããªãã¨ãã§ãã¾ãããã¡ãããéã«ãã¼ã«ãä¸ãã¦ããã¼ã«é ä¸ã®ãã¹ã群ã«ãã¹ããåãã¨ãããã¨ãå¯è½ã§ãã Serverspecã¯è¯ãæå³ã§ããã¹ã管çæ©è½ããµãã¼ããã¦ããªãã®ã§ãAPIã§åçã«ãã¹ãæ å ±ã¨å®è¡ãã¹ãspecãã¡ã¤ã«ã対å¿ã¥ããã®ã¯ç°¡åã§ãã
ãã£ã¬ã¯ããªã¬ã¤ã¢ã¦ã
ãã¼ã ã®Serverspecã®ãã£ã¬ã¯ããªã¬ã¤ã¢ã¦ãã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
base_spec.rb
ã«åãã¼ã«å
±éã®specãæ¸ããservice ãã£ã¬ã¯ããªä»¥ä¸ã«Mackerelã®ãµã¼ãã¹ã»ãã¼ã«ã«å¯¾å¿ããspecãæ¸ãã¾ãã
ããã«ã¦ã§ã¢åä½ã§specãã¾ã¨ããããã¨ãããã¾ãããããªã¨ãã¯ãcommon ã¨ãããã£ã¬ã¯ããªä»¥ä¸ã«è¤æ°ã®ãã¼ã«éã§ä½¿ãã¾ãããããªspecãæ¸ãã¾ããï¼å®éã®ã¬ã¤ã¢ã¦ãã¨ã¯è¥å¹²ç°ãªãã¾ãããã ããããã®ããã«ãªã£ã¦ãã¾ããï¼
spec âââ common â  âââ nginx â  â  âââ default.rb â  â  âââ proxy.rb â  âââ postgresql â  âââ default.rb â  âââ master.rb â  âââ slave.rb âââ base_spec.rb âââ service â  âââ myblog â  â  âââ proxy_spec.rb â  â  âââ app_spec.rb â  â  âââ db-master_spec.rb â  âââ mybookmark â  âââ proxy_spec.rb â  âââ app_spec.rb â  âââ db-master_spec.rb â  âââ db-slave_spec.rb âââ spec_helper.rb
Thorfile
Rakefileã¯æ¸ãæ¹ãé£ããã¦ãã¾ã好ãã§ã¯ãªãã®ã§ãThor ã使ã£ã¦ã¿ã¾ããã Thorã¯ç°¡åã«ã³ãã³ãã©ã¤ã³ã®ã¤ã³ã¿ãã§ã¼ã¹ãä½ãã¦ä¾¿å©ã§ãã ãã¡ãããServerspecããã©ã«ãã®rakeã使ã£ã¦ãåé¡ããã¾ããã
ä¾ãã°ã以ä¸ã®ãããªThorfileãç¨æãã¦ããã¾ããmackerel-client-rubyã使ã£ã¦ãä¸ãããããã¹ãåããAPIãå¼ãã¦ãã¹ãæ å ±ãåå¾ãããµã¼ãã¹ã»ãã¼ã«åããé©ç¨ããspecãã¡ã¤ã«ã®ä¸è¦§ãã ããrspec ã³ãã³ãã«æ¸¡ãã¦ããã¾ãã
require 'mackerel/client' RSPEC_OPT = ENV['SABASPEC_RSPEC_OPT'] || '--format doc -c' class Spec < Thor include Thor::Actions default_task :host desc 'host', 'run spec for a host' def host(hostname) mackerel = ::Mackerel::Client.new(mackerel_api_key: MACLEREL_API_KEY) host = mackerel.get_hosts(name: hostname).first # åãååã®ãã¹ãã2ã¤ä»¥ä¸åå¨ããªãåæ raise "Not found host #{hostname}" if host.nil? spec_files = ['spec/base_spec.rb'] spec_files += host.roles.flat_map {|service, roles| roles.flat_map {|role| "spec/service/#{service}/#{role}_spec.rb" } }.select {|f| FileTest.exist?(f) } ENV['ASK_SUDO_PASSWORD'] = '1' ENV['RSPEC_SSH_HOST'] = hostname run("bundle exec rspec #{RSPEC_OPT} -r spec_helper #{spec_files.join(' ')}") end end
以ä¸ã®ã³ãã³ãã§ãã¹ãåã渡ãã¦ããã°ãå®è¡ã§ãã¾ãã
bundle exec thor spec:host myblog001
Mackerelã§ç®¡çãã¦ãããã¹ã¦ã®ãã¹ãã«ä¸çºã§é©ç¨ããã¨ãã£ããã¨ãã¿ã¹ã¯ãå®è£ ãã¦ããã°ç°¡åã«ã§ããã¨æãã¾ãã
ãµã¼ãä¸ã§Serverspecããã¼ã«ã«å®è¡ãã
Mackerel APIãç¨ãã¦ããã¹ãæ å ±ç®¡çã«ä½åãªæéãå²ããªãã¦ãããªãã¾ããã ããããChefã§æ§ç¯ããããä»®æ³ãã¹ããå¼ã£è¶ããããããã³ã«ãæå ã®ç«¯æ«ããServerspecãå®è¡ããã®ãé¢åã§ãã é¢åã«ãªã£ã¦ãã¾ãã¨ããå¿ãããã¨ããããçµå±ã¯äºæ ã«ã¤ãªããããããã¾ããã ãããã£ã¦ãã¹ã ã¼ãºã«éç¨ã«çµã¿è¾¼ãããã«ã¯ããã²ã¨å·¥å¤«å¿ è¦ã§ãã
ããã§ãä»ã®éç¨ã§ã¯ãã¹ãã®ã¹ãã¼ã¿ã¹ãmkr ãç¨ãã¦ãµã¼ãä¸ã§å¤æ´ãã¦ãããã¨ãå¤ããã¨ã«çç®ãã¾ããã ä¾ãã°ããµã¼ãã¹ã¤ã³ã®åã®ãsshãã°ã¤ã³ãã¦ãããµã¼ãã®Mackerelä¸ã®ã¹ãã¼ã¿ã¹ãstandbyã«ããå ´åã¯ã以ä¸ã®ãããªã³ãã³ããå©ãã¾ãã
(ãã°ã¤ã³å ) mkr update --st standby
ããã®ä»£ããã«ãserverspecãå®è¡ã§ããã°ããã®ã§ã¯ã¨èãã¾ãããå ·ä½çã«ã¯ãã°ã¤ã³å ã®ãµã¼ãã§ä¸è¨ã®ããã«runspecã¨æã¤ã¨ãã¹ããå®è¡ãããMackerelä¸ã®ã¹ãã¼ã¿ã¹ãstandbyã«ãªãã¨ãããããªã¤ã¡ã¼ã¸ã§ãã
(ãã°ã¤ã³å ) runspec
ãã¨ã¯ãµã¼ãã¹æå ¥æã«workingã«ããã¨ããæµãã®ã©ã¤ããµã¤ã¯ã«ã«ãªãã¾ãã éç¨ã«ãã£ã¦ã¯ãstandbyãçµç±ããã«ç´æ¥workingã«ãã¦ãã¾ãã¨ããã»ããé¢åããªãã¦ãããã¨ãããã§ãããã
ãµã¼ãä¸ã§serverspecãå®è¡ããã«ã¯ãåãµã¼ãã§ãã«ãæ¸ã¿ã®Rubyãé å¸ãã¦ãServerspecã®specãå ¥ã£ããªãã¸ããªãcloneãã¦ãbundle installãããªã©ã®ã»ããã¢ãããå¿ è¦ã§ããããã«specãã¡ã¤ã«ã®æ´æ°ã«è¿½å¾ãã¦ããå¿ è¦ããããããcronã§æ¯æ¥git pullããã¦ãã¾ãã ãµã¼ãã®æ°ãå°ãªããã°ãcronã¾ã§ã¯å¿ è¦ãªãã¨ã¯æãã¾ãã Ansbleã使ã£ã¦ä½ããé å¸ããæ¹æ³ã¯ Ansible + Mackerel APIによる1000台規模のサーバオペレーション - ゆううきブログ ã§ç´¹ä»ãã¾ããã
è£è¶³ã§ããããµã¼ãä¸ã§Rubyããbundle installããããããç¨æããã®ãé¢åãªããdrootã使ãã®ãããããã§ããDockerfile ããæ¸ãã¦ãã¾ãã°ãdrootãã¤ããªã¨drootã§ä½æããS3ä¸ã®ã¢ã¼ã«ã¤ããé å¸ããã ãã§åãã¯ãã§ãã
Dockerとchrootを組み合わせたシンプルなコンテナデプロイツール - ゆううきブログ
Serverspecã¯sshå
ã§å®è¡ããã¢ã¼ãã¨ãã¼ã«ã«å®è¡ããã¢ã¼ããããã¾ãããã¼ã«ã«å®è¡ããã¢ã¼ã㯠spec_helper.rb ã§set :backend, :exec
ã§æå®ã§ãã¾ãã
ã¨ã¯ããããã¹ãã³ã¼ãã®éçºæã¯sshå
ã§å®è¡ããã¢ã¼ãã使ãããã®ã§ã以ä¸ã®ããã«ç°å¢å¤æ°ã§åå²ãããããªspec_helper.rbã«ãã¦ãã¾ãã
require 'serverspec' require 'pathname' require 'net/ssh' RSpec.configure do |c| if ENV['SERVERSPEC_LOCAL_MODE'] # ãµã¼ãä¸ã§å®è¡ãã set :backend, :exec else set :backend, :ssh if ENV['ASK_SUDO_PASSWORD'] require 'highline/import' set :sudo_password, ask("Enter sudo password: ") { |q| q.echo = false } else set :sudo_password, ENV['SUDO_PASSWORD'] end c.before :all do host = ENV['RSPEC_SSH_HOST'] options = Net::SSH::Config.for(host) options[:user] ||= Etc.getlogin set :host, options[:host_name] || host set :ssh_options, options end end c.path = '/usr/sbin:/sbin:$PATH' end
ãã¨ãã
Serverspecããã¾ãéç¨ã«ã®ããããã®Mackerel APIã®æ´»ç¨ã«ã¤ãã¦ç´¹ä»ãã¾ããã
APIã«ãããã¹ãæ å ±ã®ä¸å åã¨ããMackerelã®ææ³ãã¨ã¦ã好ãã§ãããã°ã©ããã«ãªã¤ã³ãã©ã®å¯è½æ§ãæãã¾ããã mkr ã tmux + ssh + Mackerel API を組み合わせたとにかくモダンなサーバオペレーション - ゆううきブログãAnsible + Mackerel APIによる1000台規模のサーバオペレーション - ゆううきブログ ã¯Mackerelãä¸å¿ã¨ããããã°ã©ããã«ãªã¤ã³ãã©ãä¿é²ãããã®ã§ãã myfinderããã«ä»¥åã®meetupã§è¯ãç´¹ä»ã®ä»æ¹ããã¦ããã ãã¾ãã mackerel-meetup-3/slide.md at master · myfinder/mackerel-meetup-3 · GitHub ã
æå¾ã«ãï¼å¹´è¿ãåã®è©±ã«ãªãã¾ãããServerspecæ¬ã®ç®æ¬ãã©ãããããã¨ããããã¾ããã
ææ¥ã¯ã¢ããã³ãã«ã¬ã³ãã¼æçµæ¥ã§ããã楽ãã¿ã«ã
- ä½è : å®®ä¸åè¼
- åºç社/ã¡ã¼ã«ã¼: ãªã©ã¤ãªã¼ã¸ã£ãã³
- çºå£²æ¥: 2015/01/17
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã° (6件) ãè¦ã