February 6th, 2010
mysqldump是非常重要的MySQL备份工具。然而在长年累月的使用过程中,TAOBAO多次出现了因mysqldump意外终止而导致备份失败的情况。
以下是我们经常遇到的问题:
1、Lost connection to MySQL server at ‘reading initial communication packet’:
这个主要是因为DNS不稳定导致的。如果做了网络隔离,MySQL处于一个相对安全的网络环境,那么开启skip-name-resolve选项将会最大程度避免这个问题。
2、Lost connection to MySQL server at ‘reading authorization packet’:
从MySQL获取一个可用的连接是多次握手的结果。在多次握手的过程中,网络波动会导致握手失败。增加connect_timeout可以解决这个问题;然而增加connect_timeout并不能防止网络故障的发生,反而会引起MySQL线程占用。最好的解决办法是让mysqldump重新发起连接请求。
3、Lost connection to MySQL server during query:
这个问题具备随机性,而淘宝MySQL的应用场景决定了我们无法多次备份数据以便重现问题。
然而我们注意到这个问题一般会在两种情况下会发生。一种是mysqldump **** | gzip ****;另外一种是mysqldump **** > /nfs-file
注意,不管是gzip还是nfs都有一种特点,那就是它们影响了mysqldump的速度。从这个角度思考,是不是mysqldump从MySQL接受数据包的速度不够快导致Lost connection to MySQL server during query错误呢?
Read the rest of this entry »
Tags: Lost connection, mysqldump, net_write_timeout
Posted in MySQL Error | No Comments »
February 6th, 2010
“And God said, Let there be network: and there was timeout”
在使用MySQL的过程中,你是否遇到了众多让人百思不得其解的Timeout?
那么这些Timeout之后,到底是代码问题,还是不为人知的匠心独具?
本期Out-man,讲述咱们MySQL DBA自己的Timeout。
Read the rest of this entry »
Tags: connect_timeout, MySQL, net_read_timeout, net_write_timeout, timeout, wait_timeout
Posted in MySQL Internals | 1 Comment »
February 2nd, 2010
搜索三大要素:数据来源、预处理、查询。
在Sphinx+MySQL的架构中,MySQL主要提供了数据来源和查询接口,真正进行全文索引建立和查询的是Sphinx。
MySQL里面存放真正的数据;Sphinx从MySQL中获取数据建立全文索引;应用程序使用相应的api与Sphinx交互以获得真正的数据(此处的api包含SQL接口、php接口,以及其他一些编程语言能够调用的接口)。
Read the rest of this entry »
Tags: fulltext, MySQL, search engine, Sphinx
Posted in My Study | No Comments »
January 17th, 2010
MyISAM自带的全文索引无法与ORACLE相比。要想在MySQL上使用全文索引,那就只能看第三方的工具罗。
据说Sphinx很不错,于是看了下安装方法,之后有时间再做性能压测。
Read the rest of this entry »
Tags: fulltext, install, MySQL 5.1, Sphinx, 全文索引, 安装
Posted in My Study | 1 Comment »