DevOpsã§ã¨ã³ã¸ãã¢ã解æ¾ã§ããã
ãã¨ã¯ã·ã¼ãã¯ãæè¿ã§ã¯çããã社å¡ã®ãããã90ï¼ ä»¥ä¸ãã¤ã³ãã©ã¨ã³ã¸ãã¢ã¨ããä¼ç¤¾ã§ããããã®ä¸ã§ãããã©ã³ã§ããåèåè¡æ°ã¯ãã¤ã³ãã©ã¨ã³ã¸ãã¢ã®æ°ã¯å°ãªãã®ã«ãè¦æ±ããããã¨ã¯å¤ããã¨æãã¦ãããä¾ãã°ãææ¥ã¾ã§ã«ã·ã¹ãã ãç¨æãã¦æ¬²ãããã¨è¨ããã¦ããéããã人æ°ã§ã¯ã§ãããã¨ã«éçãããã
ãããã§ã5å¹´ã»ã©åã¾ã§ã¯ãããã°ãã°ä½ã¨ããªã£ãããè¿å¹´ã§ã¯ããããç¡çã«ãªã£ã¦ããããã®èæ¯ã«ã¯ãITæè¡ã®é²åãè¤éåããããä¸äººã®ã¨ã³ã¸ãã¢ããã¹ã¦ã®ã¹ãã«ã»ãããæã¤ãã¨ãå°é£ã«ãªããå°éåãé²ãã§ããããã®ä¸ã§ãéçºvséç¨ãã¨ã³ã¸ãã¢vså¶æ¥ãä¼ç»é¨évsæè¡é¨éã¨ãã£ãçµç¹ãã°ã«ã¼ãéã§ããã©ã¡ãããåã¹ã°ãä¸æ¹ãæ³£ããã¨ãããããªä¸ç¨®ã®å¯¾ç«æ§é ãçã¾ãã¦ãããåèæ°ã¯ãä¼ç¤¾ã®ä¸ã§å¯¾ç«ãã¦ãã¦ãä¸æ¯ãªã ãã§ãä½ã解決ããªããååãã«èãããã¼ãã«ãè¶ããããã¨èªãã
ãããã§å¿ è¦ã«ãªã£ã¦ããã®ããé¢ä¿ãã人ãã³ã©ãã¬ã¼ã·ã§ã³ããä»çµã¿ã§ããããããããDevOpsãªã®ã§ã¯ãªãããã¨ããã®ãåèæ°ã®èãã ã
ãDevOpsã§éè¦ã¨ããã¦ããã®ã¯ãCultureãLeanãAutomationãMeasurementãSharingã ãã³ã©ãã¬ã¼ã·ã§ã³å®ç¾ã大äºã¨ããæåãé¸æããä¸ã§ç¡é§ããªãããèªååããåãçµã¿ã測å®ããæ å ±ãå ±æããã
ChefãMcollectiveã®ç¹å¾´ã¨ä½¿ç¨ä¾
ãæè¿ãDevOpsã¨ããã¨ãChefãPuppetãCFEngineãªã©ã話é¡ã«ãªããç¹ã«Chefã¯ãFacebookããã¼ã¿ã»ã³ã¿ã¼èªååãã¼ã«ã¨ãã¦ææ°ãã¼ã¸ã§ã³ãå ¨é¢æ¡ç¨ãããªã©ããããçãä¸ãã£ã¦ããããã ãChefã®èªç¥åº¦ã¯ç¢ºå®ã«ä¸ãã£ã¦ããããå®éã«ä½¿ã£ã¦ããã¨ã³ã¸ãã¢æ°ã¯ä¼¸ã³ã¦ããªãã
ãåèæ°ã¯Chefãå®éã«ä½¿ã£ã¦ã¿ã¦ãããèãã¦ä½ããã¦ãããã¨æã£ã¦ãããä¾ãã°Chefã®æé æ¸ã¨ããããã¯ãã¯ããã¯ã«ã¯ã大ããªããããããã
ãä¾ãã°MySQLãã¤ã³ã¹ãã¼ã«ããå ´åãã¾ãRecipeã¨ããåä½ã§ãã©ãããç®çãªã®ãããã ã®ã¯ã©ã¤ã¢ã³ãã¨ãã¦ãªã®ããããã¨ããµã¼ããªã®ããªã©ã管çãããTemplateã¯è¨å®ãã¡ã¤ã«ãResourceã§ã¯ã¤ã³ã¹ãã¼ã«ããã¼ã¸ã§ã³ç®¡çãè¡ããAttributeã§ãµã¼ãåºæã®æ å ±ã管çããã
ãã§ã¯å ·ä½çã«ã¯ã©ãããApacheã®ã¤ã³ã¹ãã¼ã«ã§ããã°ããpackage "apache2" do action :installãendãã ãæ¸ãã°å®äºãããåæ§ã«ã¤ãã¼ãã«ãèªåèµ·åãè¨å®ãã¦èµ·åããã®ã¯ãservice "apache2" do action [ :enable, :start ] endããè¨å®å¤ï¼attributeï¼ã¯…ãListen <%= port %> NameVirtualHost *:<%= port %>ã…ã¨ããããã«ãé常ã«ç°¡åã ã
ãChefã§ã¯ãã¹ã¯ãªãããããç°¡åã確å®ã«è¨è¿°ã§ãããä¾ãã°ã©ããããããã±ã¼ã¸ãåã£ã¦ãã¦ã¤ã³ã¹ãã¼ã«ããæä½ãã¹ã¯ãªããã§æ¸ãã¨ããã¤ã³ã¹ãã¼ã«æ¸ã¿ãã©ããã確èªãã¦ãããã¨æ¸ããã¨ãä¸è¬çã ããChefã§ã¯ä¸åå®è¡ããã¦ããã¨èªåçã«ã¹ããããã¦ããããããããç´°ãããã¨ãèããªãã¦ãæ¸ããã¨ãã§ããã
ãã¾ããå¿ ãæå¾ ããéãã®çµæãæ»ã“ã¹ãç槔ããããApacheãèµ·åãã¦ããç¶æ ãæ£ã¨ãã¦è¿ã£ã¦ããã®ã§ããã°ãChefãå®è¡ããã¿ã¤ãã³ã°ã§Apacheãå¿ ãèµ·åããè½ã¡ãã°åèµ·åããã1ã¤ã®ã¯ãã¯ããã¯ã§æ¸ãã°ãããä¸ã¤ä¸ã¤ã¹ã¯ãªãããæ¸ãå¿ è¦ã¯ãªãããã åèæ°ã¯ãChefã¯ãæè»æ§ã¯ããã®ã ããåããã«ããé¨åãããã®ã¯ç¢ºããã¨ãèªãã
ãChefã«ç¶ããåèæ°ã¯Puppet labsã®ãããã¯ããMcollectiveãç´¹ä»ãããããã¯æ¡ä»¶ã«ãããããè¤æ°ã®ãµã¼ã群ã«å¯¾ãã¦ä»»æã®ãªãã¬ã¼ã·ã§ã³ãä¸æ¬å®è¡ã§ãããã¼ã«ã§ãéåæã§ã¡ãã»ã¼ã¸ãããªããªã¼ã§ããã¨ããç¹å¾´ããããå®éã¯ã¡ãã»ã¼ã¸ãæããåã«ä¸åº¦ãactiveMQã«å ¥ãã¦ããããã¼ãå´ãããã«ãã¥ã¼ãåãã«æ¥ãå½¢ã«ãªãããã大ããã¹ã±ã¼ã©ããªãã£ãããã
ãä¾ãã°å®éã®Mcollectiveã®ã³ãã³ãã§ããApacheã®ãµã¼ãã¹ãªã¹ã¿ã¼ãã10å°ãã¨ã«ããããã¦ã2ç§éã®ã¹ãªã¼ãã§ã26å°åæã«å®è¡ããããæ¸ãã¨ä»¥ä¸ã®ã¨ããã«ãªãã
% mco service restart httpd --batch 10 --batch-sleep 2 Discovering hosts using the mongo method .... 26 * [=============================> ] 26 / 26 Finished processing 26 / 26 hosts in 6897.66 ms
ãã¾ãã¯ã
% mco rpc service restart service=httpd -W country=uk
ã¨ããããã«ããW country=ukãã¨æ¸ãã°ãukã«å±ãããã¼ãã«ã ããã®ã³ãã³ããé å¸ããå®è¡ã§ããã