金仓数据库KingbaseES V8R3集群运维案例之---message length (8) in slot 1 does not match with slot 0(12)故障__

文章描述了在KingbaseESV8R3集群环境下,通过9999端口连接kingbasecluster服务时遇到的messagelength错误。该故障出现在备库尝试连接时,错误信息显示slot1和slot0的消息长度不一致。问题源于主备库sys_hba.conf配置文件中的用户认证方式不同。解决方法是确保主备库的配置文件保持一致,以避免生产环境中出现此类故障。
摘要由CSDN通过智能技术生成

案例说明:
在KingbaseES V8R3集群在连接kingbasecluster服务(9999端口)时,出现“message length (8) in slot 1 does not match with slot 0(12)”故障,通过复现,获取故障发生的原因。故障信息如下图所示: file

适用版本: KingbaseES V8R3

集群状态: file

一、配置备库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文件
如下图所示,当备库和主库的配置不同时: file

二、连接备库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日志中显示: file

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: file

四、连接主备库的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)“的故障,在生产环境中注意集群配置文件配置,主备库配置要一致。 更多信息,参见https://help.kingbase.com.cn/v8/index.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值