Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP stream反向代理mysql,开启ngx_healthcheck_module会出现非常多的connection errors #33

Open
txke opened this issue Jul 10, 2020 · 3 comments

Comments

@txke
Copy link

txke commented Jul 10, 2020

用tcp stream反向代理mysql,开启ngx_healthcheck_module会产生非常多的错误链接,最终导致用域名反向代理链接失败,实际数据库服务器没问题,这个不知道是什么问题。错误提示是:ERROR 1129 (HY000): Host 'x.x.x.x' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

@zhouchangxun
Copy link
Owner

zhouchangxun commented Jul 11, 2020

这个是因为只对后端做了tcp连接性检查,没有和后端进行mysql协议交互造成的。

如果针对mysql协议层进行检查,是否需要真正登录成功才可以?这样的话需要在nginx配置中暴露myql用户名密码,又会带来安全问题。

上一个issue #32 中提到的host_cache_size = 0 是不是可以规避此问题?

@acheng-floyd
Copy link

host_cache_size = 0 只能规避nginx IP不会被block,但是如果5.7.19默认的日志级别不调整的话,还是会输出很多note错误信息到mysql错误日志中,现在我这边是把mysql的日志级别从默认的3调到2了,log_error_verbosity=2,我的版本是5.7.19,我看了官方文档,不同的版本这个默认日志级别是不一样的

@txke
Copy link
Author

txke commented Jul 12, 2020

关闭host_cache_size就像上面说的,只能规避IP不会被block,但是日志会输出很多,如果是开发就没办法了,线上的话要调整日志输出

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants