mysqlã®ãã°ãã¡ã¤ã«ã®ãµã¤ãºãå¤æ´ãã
ãã¤ããªãã¼ã¿ãæ ¼ç´ããããã«ãBLOBåããã®æ¡å¼µã®MEDIUMBLOBåãå©ç¨ããã·ã¼ã³ãææãããã¨æãã¾ãã
BLOBåãå©ç¨ãã¦ãã¦ããµã¤ãºã®å¤§ããªãã¼ã¿ãDBã«æ ¼ç´ãããã¨ããã¨ãMySQLã®ãã°ã«ä»¥ä¸ã®ãããªã¨ã©ã¼ãã°ãåºåããããã¨ãããã¾ãã
100906 00:00:00 InnoDB: ERROR: the age of the last checkpoint is 9440228,
InnoDB: which exceeds the log group capacity 9433498.
InnoDB: If you are using big BLOB or TEXT rows, you must set the
InnoDB: combined size of log files at least 10 times bigger than the
InnoDB: largest such row.
ããã¯ãMySQLã®ãã°ãã¡ã¤ã«ã®ãµã¤ãºãå°ããããã«çºçãã¾ãã
MySQLã¯ããã¼ãã«ã¹ãã¼ã¹ã®æ´æ°ã«æéãããããããç´æ¥ãã¼ãã«ã¹ãã¼ã¹ãæ´æ°ããã®ã§ã¯ãªããæåã«ãã°ãã¡ã¤ã«ã«å ¨ã¦ã®æ´æ°ãæ¸ãè¾¼ã¿ããã®ãã¨éåæã§ãã¼ãã«ã¹ãã¼ã¹ãæ´æ°ããã¨ããä»çµã¿ã«ãªã£ã¦ãã¾ãã
ãã®ãã°ãã¡ã¤ã«ã»ãµã¤ãºã¯ããã©ã«ãã§5MBãè¨å®ããã¦ãã¾ããããã°ãã¡ã¤ã«ã®åè¨ãµã¤ãºã¯ã innodb_log_files_in_group ã¨ããè¨å®å¤(ããã©ã«ã2)ã¨ãinnodb_log_file_size ã¨ã®ç©ã§ããã¼ã¿ã«10MBã¨ãªãã¾ãã
ãã®ããã10MB以ä¸ã®ãã¡ã¤ã«ãDB(MEDIUMBLOB/BLOBåã®ã«ã©ã )ã«æ ¼ç´ãããã¨ããã¨ãã°ãã¡ã¤ã«ãµã¤ãºããªã¼ãã¼ãã¦ãã¾ããã¨ã©ã¼ã¨ãªãããããã°ãã¡ã¤ã«ã®ãµã¤ãºãæ¡å¼µããªããã°ãªãã¾ããã
ã§ã¯ãã©ã®ãããªæé ã§ãã°ãã¡ã¤ã«ã®ãµã¤ãºãå¤æ´ããã°ãããã解説ãã¾ãã
MySQLãµã¼ããæ®éã«ã·ã£ãããã¦ã³ããå ´åããã¼ãã«ã¹ãã¼ã¹ã«åæ ããã¦ããªããã¼ã¿ããã°ãã¡ã¤ã«ã«æ®ãå¯è½æ§ãããããããã°ãã¡ã¤ã«ã®ãµã¤ãºãå¤æ´ããå ´åã¯ãMySQLãµã¼ãã®åæ¢ã¨åæã«ãã¼ãã«ã¹ãã¼ã¹ã¸ãã°ãã¡ã¤ã«ã®å 容ããã¹ã¦åæ ããå¿ è¦ãããã¾ããå ·ä½çã«ã¯ãinnodb_fast_shutdown=0 ãè¨å®ããªããã°ãªãã¾ããã
è¨å®å¤ã確èªããã«ã¯ãmysqlã³ãã³ãã§ãã¼ã¿ãã¼ã¹ã«æ¥ç¶ãã¦ä»¥ä¸ã®ã³ãã³ããçºè¡ãã¦ãã ããã
Variable_name | Value | ||
innodb_fast_shutdown | 1 |
ä¸è¨ã®å ´åãè¨å®å¤ã1ã§ããããããã°ãã¡ã¤ã«ã®ãã¼ã¿ããã¼ãã«ã¹ãã¼ã¹ã«åæ ãããªãå¯è½æ§ãããã¾ãã
ãã®ãããä¸è¨ã®ã³ãã³ãã§è¨å®å¤ãå¤æ´ãã¾ãã
ã¤ãã§ã«ããã°ãã¡ã¤ã«ã®ãµã¤ãºã確èªããå ´åã¯ã以ä¸ã®ã³ãã³ããçºè¡ãã¦ãã ããã
Variable_name | Value | ||
innodb_log_file_size | 5242880 |
Valueã¯Byte表示ã§ãããããã5MBã¨ãªãã¾ãã
innodb_fast_shutdownã®è¨å®ãçµãã£ããããµã¼ãã¹ãåæ¢ããããããMySQLãµã¼ããåæ¢ãã¾ãã
ï¼MySQLãµã¼ããåæ¢ããåã«ãmysqldumpçã§ããã¯ã¢ãããåå¾ãã¦ãããã¨ãæ¨å¥¨ãã¾ãã
# /etc/init.d/mysqld stop
ç¶ãã¦ããã°ãã¡ã¤ã«ãé©å½ãªå ´æã«éé¿ãã¾ãã
ãããããªãã¨ä¸è¨ã§è¡ãè¨å®è¿½å å¾ã«ãMySQLãµã¼ããèµ·åããªãããããã¾ããã
次ã«ãã°ãã¡ã¤ã«ã®ãµã¤ãºã®è¨å®å¤ãå¤æ´ãè¡ãã¾ãã
è¨å®ãã¡ã¤ã«ã¯ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã«ããç°ãªãããããã¾ããããLinuxã®å ´åãåºæ¬çã«ã¯ /etc/my.cnf ã¨ãªãã¾ãã
"[mysqld]" ã®è¨å®ã«ä»¥ä¸ã追å ãã¾ãã
innodb_log_file_size=64M
ï¼ããã§ã¯64MBã«è¨å®ããã¨ãã¾ãã
è¨å®ããããMySQLãµã¼ããèµ·åãã¦ãã ããã
# /etc/init.d/mysqld start
ããã¨ããã°ãã¡ã¤ã«ãæ°è¦ã«ä½æããããµã¼ããèµ·åãã¾ãã
æ¬å½ã«64MBã®ãã°ãã¡ã¤ã«ãä½æããããã確èªããã«ã¯ãmysqlã®ãã°( /var/log/mysqld/mysql.log )ã確èªãã¾ãããã
100906 00:00:00 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 64 MB
InnoDB: Database physically writes the file full: wait...
100906 00:00:00 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 64 MB
InnoDB: Database physically writes the file full: wait...
ãã®ãã°ããã64MBã®ãã°ãã¡ã¤ã«ã2ã¤ä½æããããã¨ããããã¾ãã
ãã¨ã¯ãä¸è¨ã®ã³ãã³ãã§ãè¨å®ããå¤(64MB)ã«å¤æ´ãã¦ãããã¨ã確èªãã¾ãããã
以ä¸ããã°ãã¡ã¤ã«ã®ãµã¤ãºå¤æ´æé ã¨ãªãã¾ãã
ä»ã«ããBLOBåãMEDIUMBLOBåçãå©ç¨ãã¦ããå ´åã¯ãmysqldumpæã« hexblobãªãã·ã§ã³ãmax_arrow_packetã®è¨å®ãããªãã¨ããã¯ã¢ãããã¼ã¿ãæ å ±æ¬ è½ãã¦ããããããã¯ã¢ãããã§ããªãã£ãããã¾ãã®ã§ããã¡ããåããã¦ç¢ºèªãã¦ããã¾ãããã
ãè£è¶³ã
ä»åã解説ããå
容ã¯ãMySQL 5.0/5.1 ã§è©¦ããã¨ãã®æé ã¨ãªãã¾ãã