KingbaseES V8R6集群运维案例之---主备failover切换原因分析
案例说明:
生产环境,KingbaseES V8R6的集群发生failover切换,分析集群切换的原因。
适用版本:
KingbaseES V8R6
集群架构:
137.xx.xx.67主 原备库
137.xx.xx.94 原主库
137.xx.xx.68 vip地址
一、日志分析
1、分析原备库hamgr.log
如下所示,通过原备库hamgr.log日志获取到具体的故障时间:
2023-10-30 06:54:29] [WARNING] unable to ping "user=esrep dbname=esrep port=15555 host=137.xx.xx.94 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3"
[2023-10-30 06:54:29] [DETAIL] PQping() returned "PQPING_NO_RESPONSE"
[2023-10-30 06:54:29] [WARNING] unable to connect to upstream node "node1" (ID: 1)
[2023-10-30 06:54:29] [INFO] sleeping 6 seconds until next reconnection attempt
[2023-10-30 06:54:35] [INFO] checking state of node 1, 1 of 10 attempts
[2023-10-30 06:54:45] [WARNING] unable to ping "user=esrep connect_timeout=10 dbname=esrep host=137.xx..94 port=15555 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3 fallback_application_name=repmgr"
[2023-10-30 06:54:45] [DETAIL] PQping() returned "PQPING_NO_RESPONSE"
[2023-10-30 06:54:45] [INFO] sleeping 6 seconds until next reconnection attempt
[2023-10-30 06:54:51] [INFO] checking state of node 1, 2 of 10 attempts
.......
2、查看原主库sys_log日志
如下所示,原主库缺失了“2023-10-30 06:53:32” 至 “2023-10-30 08:40:38”的日志,至少可以判断在这段时间数据库服务没有被启动。
2023-10-30 06:53:32 CST[3063476]:[1-1] user=cocall,db=cocall,app=Kingbase8 JDBC Driver,client=137.17.17.90LOG: duration: 166.938 ms execute <unnamed>: SELECT distinct cd.remoteId, cd.remoteDid from ccUserDomain cud inner join ccDomain cd on cud.did = cd.did inner join ccUser cu on cud."uid" = cu."uid" where cd.remoteDid is not null and cu.remoteUid is null
----------缺失日志-------
2023-10-30 08:40:38 CST[96015]:[9-1] user=,db=,app=,client=WARNING: empty user key file.
2023-10-30 08:40:38 CST[96068]:[1-1] user=,db=,app=,client=LOG: database system was interrupted; last known up at 2023-10-30 06:30:05 CST
2023-10-30 08:40:39 CST[96071]:[1-1] user=esrep,db=esrep,app=[unknown],client=137.17.17.94FATAL: the database system is starting up
2023-10-30 08:40:39 CST[96072]:[1-1] user=esrep,db=esrep,app=[unknown],client=137.17.17.94FATAL: the database system is starting up
2023-10-30 08:40:39 CST[96068]:[2-1] user=,db=,app=,client=LOG: database system was not properly shut down; automatic recovery in progress
2023-10-30 08:40:39 CST[96068]:[3-1] user=,db=,app=,client=LOG: redo starts at 9/62075558
2023-10-30 08:40:39 CST[96068]:[4-1] user=,db=,app=,client=LOG: redo wal segment count 29
2023-10-30 08:40:39 CST[96068]:[5-1] user=,db=,app=,client=LOG: invalid record length at 9/620816D8: wanted 24, got 0
2023-10-30 08:40:39 CST[96068]:[6-1] user=,db=,app=,client=LOG: redo done at 9/620816A8
2023-10-30 08:40:39 CST[96068]:[7-1] user=,db=,app=,client=LOG: checkpoint starting: end-of-recovery immediate
2023-10-30 08:40:39 CST[96068]:[8-1] user=,db=,app=,client=LOG: checkpoint complete: wrote 16 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.472 s, sync=0.003 s, total=0.499 s; sync files=15, longest=0.002 s, average=0.000 s; distance=48 kB, estimate=48 kB
2023-10-30 08:40:39 CST[96015]:[10-1] user=,db=,app=,client=LOG: database system is ready to accept connections
3、查看原主库kbha.log日志
通过原主库kbha.log日志,没有发现磁盘读写异常、网关连接失败的故障;但是也缺失了“2023-10-30 06:53:39” 至 “2023-10-30 06:57:03”的日志,这段时间主库主机应该出现异常。
[2023-10-30 06:53:39] [NOTICE] PING 137.17.17.65 (137.17.17.65) 56(84) bytes of data.
--- 137.17.17.65 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1018ms
rtt min/avg/max/mdev = 0.191/0.214/0.238/0.023 ms
---------- 缺失日志--------------
[2023-10-30 06:57:03] [NOTICE] the kbha is starting ...
[2023-10-30 06:57:03] [NOTICE] [thread 227340768] the values of 'mount_point_dir_list' is NULL, set it as 'data_directory'
[2023-10-30 06:57:05] [NOTICE] PING 137.17.17.65 (137.17.17.65) 56(84) bytes of data.
4、分析主库节点系统message日志
如下所示,在“Oct 30 06:54:07” 至 “Oct 30 06:56:11" ,message缺失一分钟的日志,判断系统出现系统hang住的异常。并且在”“Oct 30 06:56:11"系统出现重启的日志。
Oct 30 06:54:07 xc-v-ct-shgy-spba-db-31 audit: PROCTITLE proctitle=62617368002D63004C414E473D656E5F55532E757466383B504154483D2F7573722F6C6F63616C2F7362696E3A2F7573722F6C6F63616C2F62696E3A2F7362696E3A2F62696E3A2F7573722F7362696E3A2F7573722F62696E3B6D7073746174202D50203120312031207C61776B2027424547494E7B69646C653D303B696E64
-------缺失1分钟日志后,系统重启,系统是否被hang主----------
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x481fd010]
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] Linux version 4.19.90-17.5.ky10.aarch64 NeoKylin Linux Adavanced Server @ CS2C (YHKYLIN-OS@localhost.localdomain) (gcc version 7.3.0 (GCC)) #1 SMP Fri Aug 7 13:35:33 CST 2020
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] efi: Getting EFI parameters from FDT:
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] efi: EFI v2.70 by EDK II
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] efi: SMBIOS 3.0=0x83bef0000 MEMATTR=0x83a542018 ACPI 2.0=0x8383e0000 MEMRESERVE=0x8383bf018
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] crashkernel reserved: 0x00000000dfe00000 - 0x00000000ffe00000 (512 MB)
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] cma: Reserved 512 MiB at 0x00000000a0000000
Oct 30 06:56:11 xc-v-ct-shgy-spba-db-31 kernel: [ 0.000000] ACPI: Early table checksum verification disabled
........
如下图所示,主库主机系统重启:

系统重启完成时间:

5、 日志信息对比分析
系统启动完成时间大约在“Oct 30 06:56:58 ”,从node94的kbha.log日志获悉,kbha进程重启在06:57后,和系统重启完的时间对应。及数据库sys_log日志缺失的时间对应,应该是系统重启后,数据库服务未启动,导致日志缺失。

二、分析总结
从以上综合分析获悉,此次集群主备failover切换,应该和主库主机系统重启导致,主库系统重启后,触发主备failover切换。
KingbaseES V8R6集群运维案例之---主备failover切换原因分析的更多相关文章
- KingbaseES V8R6集群运维案例之---repmgr standby promote应用案例
案例说明: 在容灾环境中,跨区域部署的异地备节点不会自主提升为主节点,在主节点发生故障或者人为需要切换时需要手动执行切换操作.若主节点已经失效,希望将异地备机提升为主节点. $bin/repmgr s ...
- KingbaseES R3 集群删除test库导致主备无法切换问题
案例说明: 在KingbaseES R3集群中,kingbasecluster进程会通过test库访问,连接后台数据库服务测试:如果删除test数据库,导致后台数据库服务访问失败,在集群主备切换时,无 ...
- KingbaseES V8R3集群运维案例之---主库系统down failover切换过程分析
案例说明: KingbaseES V8R3集群failover时两个cluster都会触发,但只有一个cluster会调用脚本去执行真正的切换流程,另一个有对应的打印,但不会调用脚本,只是走相关的 ...
- KingbaseES V8R3集群运维案例之---kingbase_monitor.sh启动”two master“案例
案例说明: KingbaseES V8R3集群,执行kingbase_monitor.sh启动集群,出现"two master"节点的故障,启动集群失败:通过手工sys_ctl启动 ...
- KingbaseES V8R3集群运维案例之---cluster.log ERROR: md5 authentication failed
案例说明: 在KingbaseES V8R3集群的cluster.log日志中,经常会出现"ERROR: md5 authentication failed:DETAIL: password ...
- KingbaseES V8R3集群运维案例之---用户自定义表空间管理
案例说明: KingbaseES 数据库支持用户自定义表空间的创建,并建议表空间的文件存储路径配置到数据库的data目录之外.本案例复现了,当用户自定义表空间存储路径配置到data下时,出现的故障问 ...
- kingbaseES V8R6集群备份恢复案例之---备库作为repo主机执行物理备份
案例说明: 此案例是在KingbaseES V8R6集群环境下,当主库磁盘空间不足时,执行sys_rman备份,将集群的备库节点作为repo主机,执行备份,并将备份存储在备库的磁盘空间. 集群架构 ...
- KingbaseES V8R6集群外部备份案例
案例说明: 本案例采用sys_backup.sh执行物理备份,备份使用如下逻辑架构:集群采用CentOS 7系统,repo采用kylin V10 Server. 一主一备+外部备份 此场景为主备双机常 ...
- KingbaseES V8R6集群管理运维案例之---repmgr standby switchover故障
案例说明: 在KingbaseES V8R6集群备库执行"repmgr standby switchover"时,切换失败,并且在执行过程中,伴随着"repmr stan ...
- KingbaseES V8R6集群维护案例之---停用集群node_export进程
案例说明: 在KingbaseES V8R6集群启动时,会启动node_exporter进程,此进程主要用于向kmonitor监控服务输出节点状态信息.在系统安全漏洞扫描中,提示出现以下安全漏洞: 对 ...
随机推荐
- Jsp+Servlet实现文件上传下载(四)--下载文件
接着上一篇讲: Jsp+Servlet实现文件上传下载(三)--删除上传文件 点击打开链接 本章来实现一下下载文件功能,同时优化了一下上一章中的代码. 废话少说,上代码 ------------ ...
- win32 - 虚拟内存的一些介绍
对32位Windows来说,其虚拟地址空间总数就是2的32次方,即4GB. 如果没有在引导时加上/3GB或/BOOTVA选项,Windows默认最大会分2GB给内核模式程序使用,2GB给用户模式程序. ...
- Flink本地模式安装和使用
Flink官方主页:https://flink.apache.org/ . 安装部署 不同版本的Flink对JDK版本要求不尽相同,需要根据具体的Flink版本要求先安装好JDK环境. 通常,在Fli ...
- ubuntu18.04下安装MySQL5.7
更新源 sudo apt update 安装mysql sudo apt install mysql-server 使用sudo mysql进入数据设置root账户的密码和权限 sudo mysql ...
- 《Similarity-based Memory Enhanced Joint Entity and Relation Extraction》论文阅读笔记
代码 原文 摘要 文档级联合实体和关系抽取是一项难度很大的信息抽取任务,它要求用一个神经网络同时完成四个子任务,分别是:提及检测.共指消解.实体分类和关系抽取.目前的方法大多采用顺序的多任务学习方式, ...
- Lua调试函数 debug.getinfo() namewhat详解
Lua调试的时候会用到debug.getinfo()函数,what的值文档给了解释: "Lua" : Lua function "C" : C function ...
- 【Azure 应用服务】App Service 通过 wardeploy 部署 war 包,如何指定到 root目录为wwwroot
问题描述 在部署War包到App Service时,参考文档:(使用 ZIP 或 WAR 文件将应用部署到 Azure 应用服务 : https://docs.azure.cn/zh-cn/app-s ...
- 八: Mysql配置文件的使用
# Mysql配置文件的使用 1. 配置文件格式 与在命令行中指定启动选项不同的是,配置文件中的启动选项被划分为若干个组,丽个组有一个组名, 用中括号 [ ]扩起来,像这样: 像这个配置文件里就定义了 ...
- RocketMQ(10) 消息类型
一.普通消息 1. 消息发送方式分类 Producer对于消息的发送方式也有多种选择,不同的方式会产生不同的系统效果. 同步发送消息: 同步发送消息是指,Producer发出⼀条消息后,会在收到MQ返 ...
- Netty笔记(5) - 编码解码机制 和 Protobuf技术
介绍: 编写网络应用程序时,因为数据在网络中传输的都是二进制字节码数据,在发送数据时就需要编码,接收数据时就需要解码 codec(编解码器) 的组成部分有两个:decoder(解码器)和 encode ...