2017/10/08 phpcon 2017 https://joind.in/event/japan-php-conference-2017/session05-mysqlRead less
ã¬ããªã±ã¼ã·ã§ã³ãã¦ãMySQLã§ããã¹ã¿ãã¹ã¬ã¼ããé害åæ¢ããå ´åã®ãªã«ããªãã©ã³ ã§ãæ²ããã´ã¼ã«ã§ãããããã¹ã¿ãè½ã¡ã¦ããã¼ããå¯ã¦ããããããã«ãããããã»ã¼ã§ããã®ã§ãã»ã¨ãã©ãµã¼ãã¹ãåæ¢ãããã¨ãªãããã§ã¤ã«ãªã¼ãããæ§ãã¹ã¯ãªã¼ã³ãã£ã¹ãã«åãã¾ããã åãè¾¼ã¿ãã¬ã¤ã¤ã¼ã ã¨ãå°ããã¦ããããªãã¨æãã®ã§ããªã³ã¯ç´æ¥ã§ã¿ã¦ãã ããã http://www.irori.org/pub/mysql-mm.mov ç»å ´ãããã¹ã ç»å ´ãããã¹ãã¯2å°ãdb901ã¨db902ã§ãã æåã¯ãdb901ãæ´æ°ç³»ã¯ã¨ãªãåãããã©ã¤ããªã§db900ã®æµ®åIPã¢ãã¬ã¹ãæã£ã¦ãã¾ãã ç»é¢åå² ç»é¢ã¯5åå²ãã¦ãã¾ãã å·¦ä¸ = ãselect sysdate(),@@server_idããdb900ã«å¯¾ãã¦(sleep 1ããªãã)延ã ã¨å®è¡ãã¾ãããã å³ä¸ = ping -n
MySQLã§ãã¬ããªã±ã¼ã·ã§ã³ãã¼ã¹ã®HAãªæ§æã«ã¤ãã¦èããã¡ã¢ã§ãã 3å°(ã¨ããã2å°ï¼1å°)ãããããªãã¨æã£ã¦ãã¦ãååã¯ãã®çç±ããå¾åã§ã¯{ãã¹ã¿,ã¹ã¬ã¼ã}ã{åèµ·ä¸è½ã«ãªã£ã,ã¡ãã£ã¨ãã¦ã³ãã¦ãã復帰ãã}å ´åã®ãªã«ããªãã©ã³ã«ã¤ãã¦æ¸ãã¾ãã ä»ã®ã¨ããã¯ããããã¹ãããªã¨æã£ã¦ããã®ã§ããããããããã»ããããã¨æãï¼ãããããããããï¼ããªã©ãªã©ã®ãæè¦ã¯ã³ã¡ã³ããTBãªã©ã§ããã ããã¨ããããã§ãã ã´ã¼ã« ãã¹ã¿ãè½ã¡ã¦ããã¼ããå¯ã¦ããããããã«ããã ãªã«ããªã®ä½æ¥ã¯ã§ããã ãåç´ã«ããã¤ãçæéã§å®äºããããã«ããã ããã©ãããã®ã¯ãã åºæ¬æ§æãæ¹é 2å°ï¼1å° ãµã¼ãã¹ã§ä½¿ãã®ã¯2å° (db1, db2) ãã1å°ã¯ç®¡çç¨ (db3) ã¹ã¬ã¼ããå¤æ°ä¸¦ã¹ãæ§æã«ã¯ããªã å°æ°å¢ããã¨ç®¡çã³ã¹ããä¸ãã ãã¹ã¿ãã¦ã³æã®ãã§ã¤ã«ãªã¼ãã¨ãã®ãã§ã¤ã«ã
MySQLãµã¼ãã§å¸ã«ééãããã£ã¹ã¯æ®éé害äºä¾ã¨å ±ã«ç´¹ä»ãã¾ãã ãã¡ãã¯ã以ä¸ã¨ã³ããªãããã¿ããã¯ãã¾ããã¤ã³ã¹ãã¤ã¢ãã¾ããããã¿ã¾ããã Linuxãµã¼ãããã£ã¹ã¯å®¹éä¸è¶³ã«ãªã£ãï¼ä½ãæ¶ããã°ï¼ã£ã¦ãªã£ãæã«ã©ã対å¦ããã - å RX-7ä¹ãã®é©å½ãªæ¥ã Linuxãµã¼ãã®ãã£ã¹ã¯å®¹éæ¸å°ã¢ã©ã¼ããé£ãã§ããï¼ã£ã¦ã¨ãã«ã©ã対å¦ããã - tagomorisã®ã¡ã¢ç½®ãå ´ ä»åç´¹ä»ãã対å¦ãã¿ã¼ã³ ä»åã¯4ã¤ã®æ¹æ³ãç´¹ä»ãã¾ãã ä¸è¦ãªãã¼ã¿ãã¼ã¹/ãã¼ãã«ãåé¤ ã¹ãã¼ã¯ã¨ãªãã°/ã¯ã¨ãªãã°ãåé¤ ãã¤ããªãã°ãåé¤ ã©ãã®ãã¿ã¼ã³ã«ãå±ããªãã¬ã¢ãªã·ãã¥ã¨ã¼ã·ã§ã³ ä¸è¦ãªãã¼ã¿ãã¼ã¹/ãã¼ãã«ãåé¤ ãã¾ãããããã±ã¼ã¹ã¯ç¡ãã¨ã¯æãã¾ããã DROP DATABASE foo;ãDROP TABLE foo;ã§åé¤ãã¾ãã ã¹ãã¼ã¯ã¨ãªãã°/ã¯ã¨ãªãã°ãåé¤ du -sc
ã»ã¯ã·ã§ã³5.4ãMySQL Server ãã°ãã§èª¬æããããã«ãMySQL Server ã¯å®è¡ä¸ã®ã¢ã¯ãã£ããã£ã¼ã®å 容ã確èªããã®ã«å½¹ç«ã¤ããã¤ãã®ç°ãªããã°ãã¡ã¤ã«ãä½æãããã¨ãã§ãã¾ãã ãã ããå¤ãã®ãã£ã¹ã¯ã¹ãã¼ã¹ãå æããããªãããã«ããããã«ããããã®ãã¡ã¤ã«ãå®æçã«ã¯ãªã¼ã³ã¢ããããå¿ è¦ãããã¾ãã ãã®ã³ã°ãæå¹ã«ã㦠MySQL ã使ç¨ãã¦ããã¨ããå¤ããã°ãã¡ã¤ã«ãã¨ãã©ãããã¯ã¢ããããã³åé¤ãã¦ãæ°ãããã¡ã¤ã«ã¸ã®ãã®ã³ã°ãéå§ãããã MySQL ã«æ示ãããã¨ãå¿ è¦ãªå ´åãããã¾ãã ã»ã¯ã·ã§ã³7.2ããã¼ã¿ãã¼ã¹ããã¯ã¢ããæ¹æ³ããåç §ãã¦ãã ããã Linux (Red Hat) ã¤ã³ã¹ãã¼ã«ã§ã¯ãmysql-log-rotate ã¹ã¯ãªããã使ç¨ãã¦ãã°ã®ã¡ã³ããã³ã¹ãè¡ããã¨ãã§ãã¾ãã RPM é å¸ãã MySQL ãã¤ã³ã¹ãã¼ã«ããå ´åã
ã¡ã³ããã³ã¹
ãç¥ãã
é害
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}