Host XXX is blocked because of many connection errors, unblock with 'mysqladmin flush-hosts
来源:互联网 发布:安智市场软件下载 编辑:程序博客网 时间:2024/06/05 17:52
nginx反向代理mysql的配置如下:
upstream mysql_server { server 172.18.3.243:3306; #check interval=3000 rise=2 fall=5 timeout=1000; }server { listen 3305; server_name localhost; access_log logs/access.log; proxy_pass mysql_server; so_keepalive on; tcp_nodelay on; }
配置完成nginx 发现代理mysql后,发现连接连接mysql经常报错,Host XXX is blocked because of many connection errors, unblock with ‘mysqladmin flush-hosts。
刚开始以为是代码出现问题导致的,后来发现是nginx的后端健康监测导致。
MySQL服务器已经从某个host接收了大量中途终止的连接,于是决定终止继续接收来自该host的连接,允许最大的连接错误数为max_connect_errors,通过show variables命令可以查询,一般为10。
解决方法:在另外一处地方执行mysqladmin flush-host或者登录进mysql执行flush hosts(本机host已经不允许登录!)。
但是flush hosts 只是治标不治本,暂时解决了问题,一会就又会出现。
真正的原因是nginx配置里我注释掉的那一行健康监测, 这会出现一个问题,就是tcp连接会掉线。原因在于当服务端关闭连接的时候,客户端不可能立刻发觉连接已经被关闭,需要等到当Nginx在执行check规则时认为服务端链接关闭,此时nginx会关闭与客户端的连接。
所以注释掉健康监测问题就解决了。
阅读全文
1 0
- Host XXX is blocked because of many connection errors, unblock with 'mysqladmin flush-hosts
- "Host 'xxx.xxx.xxx.xx' is blocked because of many connection errors; unblock with 'mysqladmin flush-
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- Host 'ETCV3' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
- 数据库-mysql--Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- Host 'host_name' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- MySQL连不上,报Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
- MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- tomcat服务器配置注意的问题
- 激活设备管理器权限,防止被卸载
- 【mysql】添加列
- rsync + lsyncd 文件实时同步/备份
- String 和StringBuilder的区别
- Host XXX is blocked because of many connection errors, unblock with 'mysqladmin flush-hosts
- 单目/双目与imu的融合(一)
- 死锁现象-Java基础070
- JSP 页面重定向
- EasyCsharp
- Request对象的主要方法
- iOS 从0到1搭建高可用App框架
- Linux 使用pppd和ppp程序进行3G/4G拨号
- 12对象的构造和析构