ã´ã¼ã«ãã³ã¦ã£ã¼ã¯ã«çªå
¥ããã¿ã¤ãã³ã°ã§è²ã
å¿ãã¦ãã¾ããããªã®ã§ãããã«Sensu Serverã®ä½ãæ¹ãã¡ã¢ã£ã¦ããã
ã¡ãªã¿ã«ãSensuã¯æè¿ãã¦ãªã¤ã³ã°ã«ãã«ããã®ã¢ãã¿ãªã³ã°ãã¼ã«ãã¤ã³ã¹ãã¼ã«ããç°å¢ã¯ãCentOS 6.5 (Linux version 2.6.32-431.11.2.el6.x86_64)ã
ã¡ãªã¿ã«ãSensué¢é£ã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯ChefãPuppetã®ä½¿ç¨ããæ¨å¥¨ããã¦ãã£ã½ãã®ã§ãä»åã¯Chefã®Cookbookããããããå©ç¨ããã¦ããã ããã(ãã®ã¨ã³ããªã§ã¯chef-soloã使ã£ã¦ç°å¢æ§ç¯ãã¦ããã)
Sensuã®Chef Cookbookã¯ä»¥ä¸ã®GitHubãªãã¸ããªã§å
¬éããã¦ããã
sensu-chefã®åå¾
# yum install -y git gcc
ã¾ããæä½éå¿
è¦ãªããã±ã¼ã¸ãyumã§ã¤ã³ã¹ãã¼ã«ãã¦ããã
# curl -L https://www.opscode.com/chef/install.sh | bash
Chef(Client)ãã¤ã³ã¹ãã¼ã«ã
# mkdir -p /var/chef/{cookbooks,data_bags,nodes}
Cookbookã¨ãã®ç½®ãå ´ãæã£ã¦ããã
# mkdir ~/workspace # cd ~/workspace
ãªãã¸ããªãcloneããé©å½ãªã¯ã¼ã¯ã¹ãã¼ã¹ãä½ã£ã¦ããã
# git clone https://github.com/sensu/sensu-chef.git
GitHubããsensu-chefã®ãªãã¸ããªãcloneããã
å¿ è¦ãªgemããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«
# PATH=/opt/chef/bin:/opt/chef/embedded/bin:${PATH}
Chefã§ã¤ã³ã¹ãã¼ã«ãããå®è¡ãã¡ã¤ã«ç¾¤ã«ãã¹ãéãã¦ããã
(Rubyé¢é£ã®ã½ããã¦ã§ã¢ã¯Chefã«embeddedããã¦ãããã®ã使ã£ãããã®è¾ºã¯ã好ã¿ã§ã)
# cd sensu-chef/ # bundle install
sensu-chefã§Gemfileãæºåãã¦ããã¦ããã®ã§ããããããé¢é£gemããã±ã¼ã¸ãbundleã§ã¤ã³ã¹ãã¼ã«ããã
éµã®æºå
# cd examples/ssl/ # ./ssl_certs.sh generate Generating a Sensu SSL data bag item ... Generating a 2048 bit RSA private key ã»ã»ã»ã»ã»çç¥ã»ã»ã»ã»ã» Write out database with 1 new entries Data Base Updated Data bag item created: ssl.json
SSLéµãä½ã£ã¦ããã
# mkdir -p /var/chef/data_bags/sensu # cp ssl.json /var/chef/data_bags/sensu/
data_bagsç¨ã®ãã£ã¬ã¯ããªã«ã³ãã¼ã
# ./ssl_certs.sh clean Cleaning up ...
generateãããã¡ã¤ã«ã¯ä¸å¿æ¶ãã¦ããã
å¿ è¦ãªä¾åCookbookã®åå¾
# cd ../.. # librarian-chef install --path=/var/chef/cookbooks
sensu-chefã§Cheffileãæºåããã¦ããã®ã§ãlibrarian-chefãå®è¡ãã¦ãé¢é£ãã¦ããCookbookãéãã¦ãããããã§ã¯Pathãæå®ãã¦ãå¿
è¦ãªCookbookã¯"/var/chef/cookbooks"ã«éç´ãã¦ããã
chef-soloã®å®è¡
# mkdir -p /etc/chef /tmp/chef-solo
chef-soloã®å®è¡ã«å¿ è¦ã¨ãªããã£ã¬ã¯ããªãä½ã£ã¦ããã
cat <<'EOF' >/etc/chef/solo.rb file_cache_path "/tmp/chef-solo" cookbook_path "/var/chef/cookbooks" data_bag_path "/var/chef/data_bags" EOF
cat <<'EOF' >/var/chef/nodes/sensu-server.json { "run_list": [ "sensu::default", "sensu::redis", "sensu::rabbitmq", "sensu::server_service", "sensu::api_service", "sensu::dashboard_service" ] } EOF
âã®ãããªæãã§ãchef-soloã®å®è¡ã«å¿
è¦ãªè¨å®ãã¡ã¤ã«2ã¤ãçæã
# chef-solo -j /var/chef/nodes/sensu-server.json
ã§ããã¨ã¯chef-soloãå®è¡ãããã°ãèªåã§Sensu Serverã¨ãé¢é£ããããã«ã¦ã§ã¢ç¾¤ãã¤ã³ã¹ãã¼ã«ï¼è¨å®ããã¦ãåãåºãã
ãã®æç¹ã§ãä¸è¨ã®"sensu-server.json"ã§run_listã«æå®ããRecipeã®ã½ããã¦ã§ã¢ãåãã¦ããã¯ãã
ã¨ãããã¨ã§ã試ãã«ããã·ã¥ãã¼ãã«ã¢ã¯ã»ã¹ãã¦ã¿ãã
http://(Sensu Serverã®IPã¢ãã¬ã¹):8080
ä¸è¨ã®URLã§ãã¢ã¯ã»ã¹ã§ããã¯ãã§ãã
ã¡ãªã¿ã«Basicèªè¨¼ãããã£ã¦ãããããã©ã«ãã ã¨(admin/secret)ã§ãã°ã¤ã³ã§ããã
ã¡ãªã¿ã«ããã®ããã·ã¥ãã¼ãã®ãã¹ã¯ã¼ããããã®ä»rabbitmqã¨ãã®ã¦ã¼ã¶/ãã¹ã¯ã¼ãæ
å ±ã¯ãChefãªãã¸ããªã®"attributes/default.rb"ã§å®ç¾©ããã¦ããã®ã§ããããã¿ã¦ç¢ºèªããããå¤ãããã£ãããããè¨å®ããã°OKã(https://github.com/sensu/sensu-chef/blob/master/attributes/default.rb)
erlangã®ã¤ã³ã¹ãã¼ã«ã§ã¨ã©ã¼ãåºãã¨ã
ä»æ¥è©¦ããã¨ãã¯ç¹ã«ã¨ã©ã¼ãåºãªãã£ãã®ã§ãä¿®æ£ãããã¨æããã§ãããåã«è§¦ã£ã¦ãã¨ãã¯ãchef-soloã§ã¤ã³ã¹ãã¼ã«ãã¦ããéä¸ã§ãerlangããã¾ãå
¥ããªãã£ããã¨ããã£ãã
ãã®ã¨ãã¯ã以ä¸ã®ãããªæãã§ããªãã¸ããªã«åå¨ãã¦ããæ£ãããã¼ã¸ã§ã³ãæå®ãã¦ããã°åé¡ãªãåããã
# diff -c /var/chef/cookbooks/erlang/recipes/package.rb{.bak,} *** /var/chef/cookbooks/erlang/recipes/package.rb.bak 2014-04-02 17:00:10.347278714 +0900 --- /var/chef/cookbooks/erlang/recipes/package.rb 2014-04-02 17:06:53.963274363 +0900 *************** *** 43,47 **** include_recipe 'yum-erlang_solutions' end ! package 'erlang' end --- 43,51 ---- include_recipe 'yum-erlang_solutions' end ! execute "yum install -y erlang-R16B03" do ! user "root" ! command "yum install -y erlang-R16B03" ! not_if { File.exists? "/usr/bin/erl" } ! end end
ã»ã»ã»ã¡ãªã¿ã«ããã®Sensu Serverã ãã ã¨ãå½ç¶ãä½ãã¢ãã¿ãªã³ã°ã§ãã¦ããªãã®ã§ãç£è¦ãã¯ã©ã¤ã¢ã³ãã®è¨å®ã«ã¤ãã¦ã¯å¥ã®ã¨ã³ããªã«è¨è¼ãããã¨ã«ãã¾ãã
ããã§ã¯ï¼ =͟͟͞͞(๑•̀=͟͟͞͞(๑•̀д•́=͟͟͞͞(๑•̀д•́๑)=͟͟͞͞(๑•̀д•́
Chefå®è·µå ¥é ~ã³ã¼ãã«ããã¤ã³ãã©æ§æã®èªåå (WEB+DB PRESS plus)
- ä½è : åç¾½é¾å¤ªé,å®è¤ç¥ä»,ä¼è¤ç´ä¹,è äºç¥å¤ªæ,並河ç¥è²´
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2014/05/22
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã° (19件) ãè¦ã