新接手四套MySQL库。检查相关的配置和日志,发现以下大量告警:
2016-11-28 18:50:15 30464 [Warning] IP address '10.176.246.55' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:15 30464 [Warning] IP address '10.176.246.55' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:15 30464 [Warning] IP address '10.176.246.53' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:15 30464 [Warning] IP address '10.176.246.53' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:15 30464 [Warning] IP address '10.176.246.56' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:18 30464 [Warning] IP address '10.180.211.39' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:18 30464 [Warning] IP address '10.180.211.27' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:23 30464 [Warning] IP address '10.176.246.54' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.55' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.53' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.53' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.53' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.56' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.56' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.56' could not be resolved: Temporary failure in name resolution
2016-11-28 18:50:25 30464 [Warning] IP address '10.176.246.56' could not be resolved: Temporary failure in name resolution
数据库业务不是很繁忙, 但是有大量的告警产生,日志文件被撑到3G左右。
出现错误的原因是MYSQL Server在本地内存中维护了一个非本地的Client TCP cache,这个cache中包含了远程Client的登录信息,比如IP地址,hostname等信息。
如果Client连接到服务器后,Mysql首先会在本地TCP池中根据IP地址解析客户端的hostname或者反解析,如果解析不到,就会去DNS中进行解析,如果还是解析失败
就是在error log中写入这样的警告信息。
可以通过两个参数来disable这个功能,在MYSQL的配置文件中[mysqld]中加入下面的参数:
[mysqld]
--skip-host-cache
--skip-name-resolve
重启数据库,该告警消失!