重庆思庄Oracle、Redhat认证学习论坛

标题: IP address could not be resolved: Temporary failure in name resolution [打印本页]

作者: jiawang    时间: 2023-1-30 16:45
标题: IP address could not be resolved: Temporary failure in name resolution
今早发现mysql日志中有非常多例如以下的警告:
   140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:26 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:26 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:27 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution

问题产生的原因:
出现错误的原因是MYSQL Server在本地内存中维护了一个非本地的Client TCP cache。这个cache中包括了远程Client的登录信息,比方IP地址。hostname等信息。
假设Client连接到server后,Mysql首先会在本地TCP池中依据IP地址解析client的hostname或者反解析,假设解析不到。就会去DNS中进行解析,假设还是解析失败
就是在error log中写入这种警告信息。



解决办法:禁用dns反查即可
能够通过两个參数来disable这个功能,在MYSQL的配置文件里[mysqld]中增加以下的參数:
[mysqld]
--skip-host-cache
--skip-name-resolve







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2