Googleãã太å¤ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ããRed Hat 7.1ããã10å¹´æ°ããDebianãã¼ã¹ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã¸ãã©ã¤ãã¢ããã°ã¬ã¼ããã話ãç´¹ä»ããã ãã®ãã¨ãèªåã®èº«ã®åãã®ç°å¢ã¨æ¯è¼ããåèã«ãã¹ããã¤ã³ããèå¯ããã
åæ㯠USENIX LISA ã®æ稿è«æã ãããããä¸èº«ã¯è«æä½ã¨ããããã¯ãäºä¾ã®ç´¹ä»ã¨ãã£ãé©åãããããªãã
MERLIN, M. Live Upgrading Thousands of Servers from an Ancient Red Hat Distribution to 10 Year Newer Debian Based One. In Proceedings of the 27th conference on Large Installation System Administration (LISA) (2013), pp. 105â114
ãã¼ãã¼ã®PDFã Live Upgrading Thousands of Servers from an Ancient Red Hat Distribution to 10 Year Newer Debian Based One | USENIX ã«ã¦å ¬éããã¦ããã LinuxCon Japan 2013ã§ãåãã¼ãã®çºè¡¨ããããçºè¡¨è³æ㯠http://marc.merlins.org/linux/talks/ProdNG-LC2013-JP/ProdNG.pdf ã«ã¦å ¬éããã¦ããã
ãã®æç« ã¯ãåæã®é¦è¨³ã§ã¯æ±ºãã¦ãªããèªåãç解ããããããã«çµã¿ç«ã¦ãªãããæç« ã§ããããã誤ããªãã誤解ãçãå¯è½æ§ããããæ£ããè¨è¿°ãç¥ãããã®ã§ããã°ãåæãåç §ãã¦ã»ããã
æ¦è¦
Googleã§ã¯å¤ªå¤ã®ãã£ã¹ããªã§ããRed Hat 7.1ãç¬èªããããéãã¦10å¹´ééç¨ãã¦ããã
Googleã®ãµã¼ãã§ã¯ãã¢ããªã±ã¼ã·ã§ã³ã¯ã«ã¼ããã¼ãã£ã·ã§ã³ã®å¤å´ã®chroot jailç°å¢ã§åä½ãããããã«ã¼ããã¼ãã£ã·ã§ã³ã®å¤æ´ãã¢ããªã±ã¼ã·ã§ã³ã«å½±é¿ããªãã ããã¾ã§ãRed Hat 7.1ã®ã´ã¼ã«ãã³ã¤ã¡ã¼ã¸ã®ãã¡ã¤ã«ãã«ã¼ããã¼ãã£ã·ã§ã³ã¸åæãããã¨ã«ãããããã±ã¼ã¸ãæ´æ°ãã¦ããã
ãã®æ¹æ³ã¯é·ãéé©ãã»ã©ãã¾ããã£ã¦ãããããããæ°¸ä¹ ã«ã¢ããã°ã¬ã¼ãã延æããããã«ã¯ãããªããå®éãã¢ãã³ãªã·ã¹ãã ä¸ã§ããã±ã¼ã¸ããã«ãã§ããªããªã©ã®åé¡ããã£ãã
ããã§ãDebianãã¼ã¹ã®ProdNGã¨ããæ°ãããã£ã¹ããªãã¥ã¼ã·ã§ã³ã¸ç§»è¡ãããã¨ã«ããã ProdNGã¯ä»¥ä¸ã®ãããªç¹å¾´ããã¤ã
- ã»ã«ããã¹ãã£ã³ã°
- ã½ã¼ã¹ããå®å ¨ã«ãªãã«ããã
- ãã¹ã¦ã®ããã±ã¼ã¸ã¯ä¸è¦ãªä¾åãåãé¤ããã (xml2, seLinux library, libacl2ãªã©)
- upstartãdbusãplymouthãªã©è¤éãªãã®ãåãå ¥ããªã
- å°ãããã°ããã ãåæãåã¤ã³ã¹ãã¼ã«ãfsckãéããªã
- æ°ããããã±ã¼ã¸ã常ã«åªãã¦ããããã§ã¯ãªããã¨ãã«ã¯å¤ããã®ã®ã»ãããããã¨ããã
- éé¢ããã¦ãããæ°ããããã±ã¼ã¸ããã«ããããã³ã«ãProdNGã®chroot jailç°å¢ãä½ãããã«ããã¼ã«ãã¤ã³ã¹ãã¼ã«ãã
ProdNGã¸ã®ç§»è¡ã®æé ã¯ä»¥ä¸ã®ãããªãã®ã ããããã¯OSã®åèµ·åãªãã«å®æ½ããã¦ããã
- ProdNGä¸ã§ãã«ãããDebianããã±ã¼ã¸ãRPMã¸å¤æãã
- ç¾è¡ã®Red Hatãã£ã¹ããªããX Serverãfontsãlocalesãman pageã®ãããªä¸è¦ãªããã±ã¼ã¸ã®åé¤
- ç¾è¡ãã£ã¹ããªã®libc 2.2.2ãããProdNGã®libc 2.3.6ã¸ã®ã¢ããã°ã¬ã¼ã
- chroot jailç°å¢ã§ã¹ã¯ã©ãããããã«ããããç´150ããã±ã¼ã¸ã®ã¢ããã°ã¬ã¼ã ProdNGã¨ç¾è¡Red Hatã¤ã¡ã¼ã¸ã®ä¸¡æ¹ã«é ç½®
- ç¾è¡Red Hatã¤ã¡ã¼ã¸ã«ãããªãRPMãdebããã±ã¼ã¸ã«å¤æ alien(1)ã¨ç¬èªã®changelogã³ã³ãã¼ã¿ã®çµã¿åãã
- ããã¾ã§ã§ãProdNGãç¾è¡Red Hatã¤ã¡ã¼ã¸ã¨åæ§ã«åä½ããããã«ãªã£ãããããªã°ã¬ãã·ã§ã³ãã¹ãããã¹ãã¦ãæåã¬ãã¥ã¼ããã®ã¡ã«ProdNGããããã¤ãã
ãããã®æé ã¯ãä¸è¨ã§ããã¨ãæ¬çªç°å¢ã§2ã¤ã®ãã£ã¹ããªã並è¡ãã¦éç¨ãããã¨ãªãã常ã«åä¸ãªç¶æ ãä¿ã£ã¦ãæ°ãããã£ã¹ããªã«ç§»è¡ãã¦ãããåã¹ãããã§æ°åå°ã®ãã¹ããåä¸ãªç¶æ ã«ä¿ã¤ãã¨ã¯ãé常ã«æéãããããå ¨å·¥ç¨ãæ°å¹´ããã¦ããéããã
ãããã¯
åç¯ã§ãã¼ãã¼ã®æ¦è¦ãã¾ã¨ãããããã§ã¯ãæ¦è¦ããçãããããã¤ãã®èå³æ·±ããããã¯ãç´¹ä»ããã ãããã®ãããã¯ã«å ãã¦ãå®éã®ç§»è¡æã®ãã©ãã«ãæ³¥èãlibcã¢ããã°ã¬ã¼ãæ¹æ³ãªã©ãèå³æ·±ããããã¯ã¯ããã¤ãããã
åæç°å¢
Googleã®æ¬çªLinuxã¯ã«ã¼ãã«ã»ããã¤ã¹ãã©ã¤ããã¦ã¼ã¶ã¹ãã¼ã¹ãã¢ããªã±ã¼ã·ã§ã³ã®3ã¬ã¤ã¤ã§ç®¡çããã¦ããã
ã«ã¼ãã«ã»ããã¤ã¹ãã©ã¤ãã¯ãã£ã¹ããªãã¥ã¼ã·ã§ã³ããã¯åãé¢ããã¦ãã¦ãé »ç¹ã«æ´æ°ãããã ãã®ã¬ã¤ã¤ã¯å¥ã®ãã¼ã ãã¡ã³ããã³ã¹ãã¦ãããä»åã®è©±ã«ã¯é¢ä¿ããªãã
åã¢ããªã±ã¼ã·ã§ã³ã¯chroot jailç°å¢ã§åä½ããããã®jailã¯ã¢ããªã±ã¼ã·ã§ã³ã®åä½ã«å¿ è¦ãªãã¹ã¦ã®ããã°ã©ã ãå ±æã©ã¤ãã©ãªããã¼ã¿ãã¡ã¤ã«ãå«ãã
æ®ãã®ã¦ã¼ã¶ã¹ãã¼ã¹é¨åã¯ãinitã¹ã¯ãªããã/usr/bin
ãã¤ããªãªã©ã ã
OSã®ããã±ã¼ã¸ã·ã¹ãã ã¯ãã®é¨åã«ã®ã¿ä½¿ãããããã¼ãã¼ã§ãã©ã¼ã«ã¹ãã¦ããã®ã¯ãã®é¨åã«ãªãã
1~2人ã§ã¡ã³ããã³ã¹ããã¦ãããããã
(â»ãã¼ãã¼ã®ã¿ã¤ãã«ã«æ°åå°ã®ãµã¼ãã¨ããããGoogleã®ãµã¼ãã¯ãã£ã¨å¤ãã¯ããã©ã®ã»ã¯ã·ã§ã³ã®ãµã¼ãã®è©±ãªã®ãã¯æ¸ããã¦ããªãã£ãã)
å¾æ¥ã®ããã±ã¼ã¸ã¢ãããã¼ã
æåæã«ã¯ãsshã«ã¼ãã§ã¤ã³ã¹ãã¼ã«ã»ã¢ãããã¼ãã³ãã³ããèµ°ããã¦ããã sshã«ã¼ãã¯å®è¡ã«æéããããã失æãããã¹ãããããã¹ã±ã¼ã«ããªãã ä¸è¬çã«ãããã·ã¥ãã¼ã¹ã®ææ³ã¯å¤±æããããã«éå½ä»ãããã¦ããã
次ã«ãcronã§apt-get/yumãå®è¡ãããã ãããæå¾ ããæ´æ°ã¯ã§ããã ããããæ°åå°ã®ãµã¼ãã§apt-get/dpkg/rpm/yumãèµ°ããã¦ããã¨ãã©ã³ãã ã§å¤±æãããã¨ãããã æ´æ°ä¸ã«åèµ·åãã¯ã©ãã·ã¥ããã¨ãããã±ã¼ã¸ãã¼ã¿ãã¼ã¹ãå£ããã ããã±ã¼ã¸ãã¼ã¿ãã¼ã¹ãå£ããªãã¦ããè¨å®ãã¡ã¤ã«ãã³ã³ããªã¯ãããããããã±ã¼ã¸ã¢ãããã¼ãã«ãããã¹ããäºæããªãç¶æ ã«ãªã£ãããªã©ã®å¤ãã®åé¡ããã£ãã
ãã¡ã¤ã«ã¬ãã«ã®ãã¡ã¤ã«ã·ã¹ãã åæãªãã°ãã©ã®ç¶æ ããã§ããªã«ãã¼ã§ãã¦ãããã±ã¼ã¸ããã¼ã¸ã£ã¼ã«ä¾åããªããªãã åãµã¼ããåä¸ã«ä¿ã¡ããµã¼ãåºæã®ããã±ã¼ã¸ã¨è¨å®ãã¡ã¤ã«ã¯åæããã¨ãªã¢ã®å¤ã«ç½®ãå¿ è¦ãããã åãµã¼ãã¯ãµã¼ãåºæãã¡ã¤ã«ã®ãªã¹ãï¼ãããã¯ã¼ã¯è¨å®ãresolve.confãsyslogãªã©ï¼ãæã¡ããªã¹ãå ã®ãã¡ã¤ã«ã¯åæããã¯é¤å¤ãããã ãã¹ãå ¨ä½ã«ãã¹ã¿ã¤ã¡ã¼ã¸ããrsyncããã®ã¯ãµã¼ãå´ï¼â»ãããããã¹ã¿ã¤ã¡ã¼ã¸ãä¿æããä¸å¤®ãµã¼ãï¼ãã¹ã±ã¼ã«ããªãã ããã«ãç¹å®ã®ãã¡ã¤ã«ãå¤æ´ãããã¨ãã«ããã¼ã¢ã³ãåèµ·åããããã®ããªã¬ã¼ãå¿ è¦ã ã
ãã®ãããç¬èªã®rsyncã©ã¤ã¯ãªã½ããã¦ã§ã¢ãæ¸ãããåºæ¬çã«ããã¹ã¿ã¤ã¡ã¼ã¸ããå ¨ãã¹ãã¸ãã¡ã¤ã«ã¬ãã«åæãè¡ããé©åã«ã·ã§ã«ããªã¬ã¼ãè¨å®ã§ãããI/Oã¯ã¹ããããªã³ã°ããããããåãã¹ãã®è² è·ã«å½±é¿ã¯ãªãã (â» rsyncã©ã¤ã¯ãªã½ããã¦ã§ã¢ã¨ã¯ããããããå¤æ°ã®ãµã¼ãã¸åæããããããããã«ãã¯ã©ã¤ã¢ã³ãå´ãå¹çåãããããªãã®ã§ã¯ãªãããåãã¹ãã§ãµã¼ãã½ããã¦ã§ã¢ãèµ·åãã¦ãã¦ããã¹ã¿ã¤ã¡ã¼ã¸ãä¿æãããã¹ãä¸ã®ã¯ã©ã¤ã¢ã³ãããã»ã¹ãåãµã¼ãã¸æ¥ç¶ãããã¡ã¤ã«åæãè¡ãããããrsyncã§ããã¨ã1ã¤ã®ãµã¼ãã«å¯¾ãã¦1ã¤ã®ã¯ã©ã¤ã¢ã³ãããã»ã¹ãæ¯åèµ·åãããã¨ã«ãªãå¹çãæªããï¼
ãã ãããã®ææ³ã¯åãã¹ããåä¸ãªç¶æ ã§ããå¿ è¦ããããåè¿°ã®ããã«ã«ã¼ããã¼ãã£ã·ã§ã³å¤ã®chroot jailã«ã¢ããªã±ã¼ã·ã§ã³ããããã¤ãã¦ããããããã§ããã¨ãããã
ãã®ãã¡ã¤ã«ã¬ãã«ã®åæã¯ProdNGãã£ã¹ããªã®æ´æ°ã«ãç¨ããã¦ããï¼ã¯ãï¼ãProdNGã®å ´åã¯ããã¹ã¿ã¼ã¤ã¡ã¼ã¸ãããããéãããã®ã§ã¯ãªããæ¯åã¯ãªã¼ã³ãªç°å¢ã§ã¹ã¯ã©ããã§ãã«ããããã¤ã¡ã¼ã¸ã¨ãªãã
ã©ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ãããã
Debianã¯æ¨æºã®Red Hatã«æ¯ã¹ã¦ãå¤ãã®ããã±ã¼ã¸ããã¤ãï¼æã®Red Hat 9ã1500ããã±ã¼ã¸ã§ãå½æã®Debianã15000ããã±ã¼ã¸ãä»æ¥ã®Fedore Core 18ãã13500ããã±ã¼ã¸ã«å¯¾ãã¦Debian Testingã40000ããã±ã¼ã¸ãï¼ Ubuntuã¯ãupstartãplymouthã®ãããªãªãã·ã§ã³ã§ããªããä¿¡é ¼ãã§ããªãããã¤ãã®è¤éããå¼·å¶ãããã
ãã£ã¹ããªã®Initã·ã¹ãã ã«ã¤ãã¦ãã以ä¸ã®ãããªè°è«ããªããã¦ããã
- Sysv:
/etc/rcX.d/Sxxdaemon
ã®ãããªã·ã¼ã±ã³ã·ã£ã«ãªãã¼ãããããããããããããé ãã - Upstart: ã·ã³ã¿ãã¯ã¹ãå®å ¨ã«ç°ãªãï¼ã·ã§ã«ããã¯ããï¼ããã¼ãé ã®ä¿è¨¼ããªããä½ããããããã£ãããããããã¯ãããã¨ããããå ´åã«ãã£ã¦ã¯ãupstartã¯åèµ·åãè¦æ±ããç¶æ ã«é¥ããã¨ãããããããã°ãé£ããã
- Systemd: 大ããªæ··ä¹±ããããããLinuxã·ã¹ãã ã®ãã¼ãã®å¤§ããªåè¨è¨ãLinuxã®ä½ã¬ãã«ãªå¤ãã®ã³ã¢é¨åãç½®ãæãããèªåã§ä¾åé¢ä¿ãè¨ç®ãã¦ãããã¨ããçæ³ã«åãã¦ãæåãªä¾åé¢ä¿ã®è§£æ±ºãè¦æ±ããããUpstartåæ§ã«ãã¼ãé ãæå®ã§ããªãã
- Insserv: åèµ·ååã«ãinsservã¯æå®ãããä¾åã解æãã¦ãinitã¹ã¯ãªãããS10ãS20ã®ããã«ãªãã¼ã ãããS10以ä¸ã®ãã¹ã¦ã®ã¹ã¯ãªããã¯åæã«èµ·åããS20ã¯S10xxã®ãã¹ã¦ãèµ·åãã¦ããèµ·åãããä¾åé¢ä¿ã®å¯è¦åã¨ã¬ãã¥ã¼ãç°¡åãProdNGã§ã¯ãããæ¡ç¨ãããã
ã¯ã¦ãªã¨ã®æ¯è¼ã¨èå¯
ã¯ã¦ãªã®æ¬çªç°å¢ã®OSã¯ã»ã¼ãã¹ã¦Linuxã§ããã£ã¹ããªã¯CentOS5ã¨Debianãæ··å¨ãã¦ããã æ°å¹´åããDebianã«ç§»è¡ãå§ãããããæè¿ã®ãµã¼ãã¹ã¯ãã¹ã¦Debianä¸ã§åä½ãã¦ããã
ã¨ã¯ãããã¾ã ã¾ã CentOS5ã®ãã¹ããæ°å¤ãæ®ã£ã¦ãããæ¥å¹´3æã®EOLã«åãã¦ãä»ã¾ãã«æ¤éä¸ã¨ããã¹ãã¼ã¿ã¹ã ã
ã¬ã¬ã·ã¼OSãæ°å¤ãæ±ãã¦ããã¨ããç¶æ³ã¯ããã¼ãã¼ã«æ¸ããã¦ããGoogleã®ç¶æ³ã«è¿ãã ãã¹ãæ°ã®ãªã¼ãã¼ãåãã ã
大ããç°ãªãã®ã¯ãã¬ã¤ã¤ãã¨ã«åé¢ãã¦ããªããã¨ã ãï¼ã¨ããããä¸è¬çã«ã¯ãåé¢ãã¦ããªãç°å¢ãå¤ãã¨æãï¼ ã¯ã¦ãªã®ç°å¢ã§ã¯ãã«ã¼ãã«ãã¦ã¼ã¶ã¹ãã¼ã¹ãã¢ããªã±ã¼ã·ã§ã³ãå¯çµåãã¦ããã OSãã¢ããã°ã¬ã¼ããããã¨æãã¨ãããããã¹ã¦ã®å¤æ´ãæèããªãã¨ãããªãã ç¹ã«Apache + mod_perl ã¨å¤ãCPANã¢ã¸ã¥ã¼ã«ãæ°ããOSã§åä½ãããã®ã課é¡ã«ãªã£ã¦ããã
ã¬ã¬ã·ã¼OSã®æ¤éã¨ä¸å£ã«ãã£ã¦ããç°å¢ã«ãã課é¡ã¯ç°ãªããGoogleã®äºä¾ã¯ç¹æ®ã«ã¿ããã ã©ã¡ããã¨ããã¨ãã¢ããã°ã¬ã¼ãã®ææ³ããããã¬ã¤ã¤å¥ã«OSã管çããææ³ãåèã«ãããã æ¯åEOLãè¿«ããã³ã«ããã¹ã¦ãã¢ããã°ã¬ã¼ãããã®ã¯ç¾å®çã¨ã¯ãããªãã
以åã«ãchrootãã¼ã¹ã®ã¢ããªã±ã¼ã·ã§ã³ãããã¤ãææ¡ ããã ã¢ããªã±ã¼ã·ã§ã³ãéé¢ããã¨ããæ¹åæ§ã¯ééã£ã¦ãªãã¨æãã
ãã¹ã¿ã¼ã¤ã¡ã¼ã¸ã®ãã¡ã¤ã«åæã«ãã管çã¯ãChefãAnsibleã®ãããªãµã¼ãæ§æ管çãã¼ã«ã§ç®¡çããææ³ã¨ã¯å¤§ããç°ãªãã ãµã¼ãæ§æ管çãã¼ã«ã«ãããããã°ã©ããã«ã«æè»ãªæ§æãã§ããä¸æ¹ã§ãè¤éåããããã10å¹´ãã¤ä»çµã¿ã¨ã¯è¨ãé£ãã
ããã§ãã«ã¼ããã¼ãã£ã·ã§ã³ã®ã¿ããã¡ã¤ã«åæã§æ´æ°ãã¦ãã¢ããªã±ã¼ã·ã§ã³ã¯chroot jailã®ãããªã³ã³ããã§åããããã®ææ³ããèªåã®ä¸ã§é·æã®éç¨ã«èããããææ³ãªã®ã§ã¯ãªããã¨æãã¦ããã
ãã¨ãã
Googleã§ããã太å¤ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ã¡ã³ããã³ã¹ã«è¦ããã§ãããããã¦ã解決ããããã«ããªãæ³¥èãæ¹æ³ãé¸æãã¦ããã¨ããã®ã¯ããµã¼ãã®æ§æ管çã®æ¬è³ªçãªé£ãããç¾ãã¦ããã®ãããããªãã
ææ³èªä½ã¯æ³¥èãä¸æ¹ã§ãã§ãããã©ããããããªãã£ãã©ã¤ãã¢ããã°ã¬ã¼ãããæè¡åãããã®ã¯ãããã§ãæ¢åã®ãã£ã¹ããªã«ãã®ã¾ã¾ä¾åãã¹ãã§ã¯ãªãProdNGã¨ããæ°ãããã£ã¹ããªããã¶ã¤ã³ããã¨ããããããã¨ãããã
ãããããã¨ãå®ç¾ã§ããæè¡åã¨ãé·æéç¨ããããã«ãã£ã¹ããªã¯ã©ãããã¹ããªã®ãã¨ãããã¸ã§ã³ã¨ãã¬ã¬ã·ã¼ãªç°å¢ãæè¡ã§è§£æ±ºãããã¨ãããã£ã¦ããæ°æã¡ãæããããã