KingbaseES V8R3集群运维案例之---message length (8) in slot 1 does not match with slot 0(12)故障
案例说明:
在KingbaseES V8R3集群在连接kingbasecluster服务(9999端口)时,出现“message length (8) in slot 1 does not match with slot 0(12)”故障,通过复现,获取故障发生的原因。故障信息如下图所示:
适用版本:
KingbaseES V8R3
集群状态:
一、配置备库sys_hba.conf文件
1、主库sys_hba.conf文件
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all ::0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication SYSTEM md5
host replication SYSTEM 127.0.0.1/32 md5
#host replication SYSTEM ::1/128 md5
host all SYSTEM 192.168.1.101/24 md5
host replication SYSTEM 192.168.1.101/24 md5
host all SYSTEM 192.168.1.102/24 md5
host replication SYSTEM 192.168.1.102/24 md5
2、备库sys_hba.conf文件
如下图所示,当备库和主库的配置不同时:
二、连接备库9999端口服务
1、备库连接9999端口服务
[kingbase@node102 bin]$ ./sys_ctl reload -D ../data
server signaled
[kingbase@node102 bin]$ ./ksql -U SYSTEM -W 123456 TEST -p 9999
ksql: ERROR: unable to read message length
DETAIL: message length (8) in slot 1 does not match with slot 0(12)
在备库cluster.log日志中显示:
2、主库连接9999端口服务
[kingbase@node101 bin]$ ./ksql -U SYSTEM -W 123456 TEST -p 9999
ksql (V008R003C002B0370)
Type "help" for help.
TEST=#
---如上所示,主库连接9999端口正常。
---如上所示,备库在连接9999端口服务时,出现“message length (8) in slot 1 does not match with slot 0(12)“错误,主库可以正常连接。
三、配置主库sys_hba.conf文件
1、备库sys_hba.conf文件
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all ::0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication SYSTEM md5
host replication SYSTEM 127.0.0.1/32 md5
#host replication SYSTEM ::1/128 md5
host all SYSTEM 192.168.1.101/24 md5
host replication SYSTEM 192.168.1.101/24 md5
host all SYSTEM 192.168.1.102/24 md5
host replication SYSTEM 192.168.1.102/24 md5
2、主库sys_hba.conf文件
如下图所示,配置主库与备库sys_hba.conf:
四、连接主备库的9999(kingbasecluster)服务
1、备库连接9999
[kingbase@node102 bin]$ ./ksql -U SYSTEM -W 123456 TEST -p 9999
ksql: ERROR: unable to read message length
DETAIL: message length (12) in slot 1 does not match with slot 0(8)
2、主库连接9999
[kingbase@node101 bin]$ ./ksql -U SYSTEM -W 123456 TEST -p 9999
ksql: ERROR: unable to read message length
DETAIL: message length (12) in slot 1 does not match with slot 0(8)
---如上所示,主备库连接9999端口都出现了”message length (12) in slot 1 does not match with slot 0(8)“故障信息。
五、总结
当主备库的sys_hba.conf中,对用户连接集群的认证方式不同时,将会出现”message length (12) in slot 1 does not match with slot 0(8)“的故障,在生产环境中注意集群配置文件配置,主备库配置要一致。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
2022-04-06 KingbaseES R6集群一键修改集群和数据库参数测试案例
2022-04-06 KingbaseES V8R6集群运维案例之---手工创建主备流复制