大ããåãã¦äºã¤ã®è©±ããã¾ããã
Chefãå°å ¥ããæã®ãèãæ¹ã
Chefã®ãããªæ§æ管çãã¼ã«ã¯ä¸è½ã§ããæ¹ããããããã(TMTOWTDI)ã®ã§ãæåã«ã©ãããããªã·ã¼ã§çµã¿ç«ã¦ãããéè¦ã«ãªãã¾ããä»åãæ¬æ°ã§ä½¿ããã«ãããã以ä¸ã®ãããªããªã·ã¼ãè¨å®ãã¾ããã
- ååãµã¼ãä¸ã§ä½æ¥ãããChefã§ç°å¢è¨å®ãå®è£ ãã
- å
¬éãããcookbooksãåå©ç¨ãã
- opscode-cookbooksã«ããã°ãããæ¢ã
- communityãgithubã«ããcookbookã使ã
- ããããã®å¿ãæã¤
- å¿ è¦ãªãã°opscode-cookbooksãªã©æ¢åã®cookbookãforkãã¦æãå ¥ãã
- åæ¥èª¿ã¹ã¦é£ããããªãã¨ã¯ããããã(èªåChef recipeâããã§ãé§ç®ãªãæ¬å½ã«æä½æ¥)
ããè¨ããã¦ããããã«ãopscode-cookbooksã¯æ§ã ãªOS/distributionã§ä½¿ããããã«æ±ç¨åããã¦ããããLWRPãdefinitionãå¤ç¨ãã¦ãã¦recipeæ¬ä½ãèªã¿è§£ããã¨ããã¨ãããªãã¯é£ããã®ã§ãããREADMEã§ã®å©ç¨ã¬ã¤ãããããªãã«æ¸ããã¦ãããããããã«å¾ã£ã¦è©¦è¡é¯èª¤ãã¦ã¿ãã ãã§ããã¾ãã¯opscode-cookbooksã«ããã°ãããæ¢ãããå®ç¾ã§ãã¾ãã
ããã§ãé§ç®ã§ããã°ãããããã®å¿ã§èªåã®cookbookãæ¸ããã¨ã«ãªãã¾ãããå®ã¯ä»¥ä¸ã®2ç¹ã ãã§ãããªãã®ãã¨ãã§ãã¾ãã
- ããã±ã¼ã¸å ¥ããã â recipeã«packageã¨serviceãæ¸ã
- è¨å®ãã¡ã¤ã«ãç·¨éããã â templates ã«çªã£è¾¼ãã§ãããç·¨éãã¦é å¸ãã
ç´ãã«ã§ããªããã¨ã¯å²ãåããã§ããã¨ããããããã°è¯ããã§ããã§ããé¨åã¯ããã¡ãã¨ã¬ãã¸ããªä¸ã§å·®å管çãã¯ãããããããã§ãããã
åé¡æèµ·ï¼ããã°ã©ã ã®ãããã¤ãChefã§ã©ãã¾ã§ããã¹ãã
å®ã¯æ¬é¡ã¯ãã£ã¡ã ã£ãã®ã§ããããã©ã³ã¹ãééãã¾ãã(ãâ`)ï¾ï¾-
opscode-cookbooksã«ã¯applicationã¨ããcookbookããããã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ãç°¡åã«å®ç¾©ã§ããããã«ãªã£ã¦ãã¾ããCapistrano風ã®æ§é ã§ã¬ãã¸ããªãããã¡ã¤ã«ãè¨ç½®ãã¦ãRailsã§ããã°ç°¡åã«Unicornãããã¯Passengerã®è¨å®ãããã»ã¹ç£è¦ã¾ã§ãã£ã¦ããã¾ãããããããè ã§ããã
å¾ããèããã°ãRedmineãWordpressãªã©ã®ããã«ã¦ã§ã¢ããã®ã¢ããªã±ã¼ã·ã§ã³ãè¨ç½®ããããã®cookbookã ã£ããã ããã¨æããã®ã§ãããä¸ã®ååéãopscode-cookbooksã§ã¾ãã¯è©¦ãã¨ããæ¹éãæãã以ä¸ã®ãããªè©¦è¡é¯èª¤ããã¾ããã
- opscode-cookbooks/application_rubyããã®ã¾ã¾ä½¿ã£ã¦ã¿ã
- runit_serviceã§Unicornã®ããã»ã¹ç®¡çã ãChefã§æ¸ã
- Capistranoã®rootã¾ã§ãChefã§çæ
- Unicornã®graceful restartã§åé¡ãã
- å¤ãããã»ã¹ãè½ã¡ããæ°ããã½ã¼ã¹ã³ã¼ããèªãã ããã»ã¹ãAddress in useã§ä¸ãããªã
- åå ã¯æªèª¿æ»
- Chefã§ã¯ã»ã¼ãªã«ãããªã â ã¤ãã³ã³
- Capistrano rootãã£ã¬ã¯ããªã®ä½æ
- å種ãã°ãã£ã¬ã¯ããªã®ä½æ
- ãã°ãã¡ã¤ã«logrotateã®è¨å®ãã¡ã¤ã«
- Unicornãç«ã¡ä¸ããinit.d scripté å¸
- MySQLã®ãã¼ã¿ãã¼ã¹/ã¦ã¼ã¶ä½æ
ä½ã®çç±ã§Unicornãè½ã¡ããã¨ããä¸å®ãããã®ã§ãrunitã®ãããªããã»ã¹ç®¡çã使ããã¨æã£ãã®ã§ããããããã¤ã¯å®å ¨ã«Capistranoã«ä»»ãããã¨ããã¨ãååæã«ãé¶ã¨ãã¾ããåé¡ãããã¾ãã
ç°¡åã«è¨ãã¨ãUnicornèªä½ã¯ãããã¤æã®bundle installã§å ¥ããããä¸åº¦ãããã¤ãããªãã¨Unicornãåå¨ããChefã®å®è¡ããããï¼ãµã¼ãã¹èµ·åã§ããªãããï¼ããã§ããä»æ¹ç¡ãã®ã§ãååã®ã¿ç©ºã®Railsããã¸ã§ã¯ããgithubã«ç¨æãã¦ããã¼ãããã¤ããã¾ãããç¸å½ã«çãæªãããæ¹ã§ãããUnicorn管çã諦ããã®ã§æçµçã«ã¯æªä½¿ç¨ã§ãã
質åï¼Chefã§ã©ãã¾ã§ãã£ã¦ãã¾ããï¼
ãã£ãã以ä¸ã®2ç¹ãèãããã¤ã³ãããªã¨æãã¾ãã
- ãµã¼ãæ§ç¯æã®ã¢ããªã±ã¼ã·ã§ã³ã®ååãããã¤
- ï¼ãããã¤ãããã¾ã§ãã®ãµã¼ãã«ã¢ããªã¯ç¡ããããã§è¯ãã®ãã©ããï¼
- APãµã¼ã(Unicornç)ã®ããã»ã¹ç®¡ç
ã¨ããããã§ãããã·ã¥ã¿ã°çã§ãæè¦ãã ããã
– #opschef_ja