Cetus:Connection error when read delay from RO backend:

背景

MySQL 5.7.24
CentOS Linux 3.10.0-693.21.1.el7.x86_64
利用网易Cetus开源中间件搭建集群环境,MySQL集群利用Group Replication的Single-Primary Mode,节点角色如下:

node1(primary),IP:192.168.233.74
node2(Secondary),IP:192.168.233.192
node3(Secondary),IP:192.168.233.51

Cetus部署在node1
按照Cetus安装说明操作后,在启动Cetus时,报错如下:

(pid=36145) 2019-01-17 17:13:51: (warning) src/network-mysqld.c:5316: con:0x2555f80 failed for server:0x2570700
(pid=36145) 2019-01-17 17:13:51: (warning) src/network-mysqld.c:5370: ...
(pid=36145) 2019-01-17 17:13:51: (warning) src/network-mysqld.c:5316: con:0x2555030 failed for server:0x25628c0
(pid=36145) 2019-01-17 17:13:51: (warning) src/network-mysqld.c:5370: ...
(pid=36145) 2019-01-17 17:13:51: (warning) src/network-mysqld.c:5316: con:0x2555420 failed for server:0x2563880
(pid=36145) 2019-01-17 17:13:51: (message) monitor thread connected to backend: 192.168.233.74:3306, cached 1 conns
(pid=36145) 2019-01-17 17:13:51: (message) monitor thread connected to backend: 192.168.233.192:3306, cached 2 conns
(pid=36145) 2019-01-17 17:13:51: (critical) monitor thread cannot connect to backend: root@192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (message) get connection failed. error: 0, text: , backend: 192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (message) change backend: 192.168.233.74:3306 from type: read/write, state: online to type: read/write, state: online
(pid=36145) 2019-01-17 17:13:51: (message) Backend 192.168.233.74:3306 is set to UP.
(pid=36145) 2019-01-17 17:13:51: (message) change backend: 192.168.233.192:3306 from type: readonly, state: online to type: readonly, state: online
(pid=36145) 2019-01-17 17:13:51: (message) Slave delay 0.040 seconds. Recovered. Set slave to UP.
(pid=36145) 2019-01-17 17:13:51: (critical) monitor thread cannot connect to backend: root@192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (critical) Connection error when read delay from RO backend: 192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (message) change backend: 192.168.233.51:3306 from type: readonly, state: down to type: readonly, state: down
(pid=36145) 2019-01-17 17:13:51: (critical) Backend 192.168.233.51:3306 is set to DOWN.
(pid=36145) 2019-01-17 17:13:51: (critical) monitor thread cannot connect to backend: root@192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (message) get connection failed. error: 0, text: , backend: 192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (critical) monitor thread cannot connect to backend: root@192.168.233.51:3306
(pid=36145) 2019-01-17 17:13:51: (critical) Connection error when read delay from RO backend: 192.168.233.51:3306

现象

可以发现node1、node2已经连接成功,但是在连接node3的时候失败。

解决方法

首先排除账号密码的问题,然后在node1本机远程访问node3的数据库,结果报错如下:

[root@node1 /usr/local/cetus]#mysql -h 192.168.233.51 -u root -p
Enter password: 
ERROR 1129 (HY000): Host '192.168.233.74' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

很明显,是由于node1连接node3数据库时报错太多,被node3的数据库封杀了。
在node3直接连接数据库执行如下命令即可:

[root@node3 /root]#mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4070
Server version: 5.7.24-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>  flush hosts;
Query OK, 0 rows affected (0.02 sec)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL是一个支持事务和ACID特性的关系型数据库。它可以通过使用中间件进行水平扩展和高可用性。Cetus是一个使用C语言开发的MySQL中间件,它提供了全面的数据库访问代理功能,使应用程序可以通过Cetus访问数据库而无需修改代码。 在MySQL和中间件的事务处理中,有几种常见的方案和技术可供选择。其中一种方案是使用触发器和用户定义函数(UDF)。触发器可以在数据库中的特定事件发生时自动执行一系列操作,而UDF是一种自定义的函数,可以扩展MySQL的功能。然而,触发器不支持事务且效率较低。 另一种方案是使用开源的中间件,如阿里开源的cannel中间件和go-mysql-transfer中间件。这些中间件通过主从复制的方式将数据同步到中间件,并将中间件伪装成MySQL的从数据库。其中部署布隆过滤器可以解决缓存穿透问题,而数据预热和加锁机制可以解决缓存击穿和缓存雪崩问题。另外,多级缓存和后台更新线程也是解决缓存雪崩问题的有效方案。 因此,MySQL和中间件的事务处理可以通过使用触发器、中间件和一些解决方案来实现数据的一致性和可靠性。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [mysql mycat 中间件安装与使用](https://download.csdn.net/download/weixin_38518958/13699558)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Cetus MySQL数据库中间件-其他](https://download.csdn.net/download/weixin_38738506/19590438)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [中间件之MYSQL](https://blog.csdn.net/qq_39256469/article/details/125482650)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值