KingbaseES V8R6集群运维系列 -- connect_check_type参数
案例说明:
在KingbaseES V8R6C7的版本中,repmgr.conf增加了connect_check_type参数可以指定参数值,默认值是‘mix’,以前版本为隐藏参数,默认值‘ping‘。connect_check_type参数可以配置为:
监控数据库connect_check_type设置:
connection_check _type:检查上游(upstream)数据库状态的方法。
ping,使用PQping()检查;
connection,建立数据库连接;
query,使用已有连接执行SELECT TRUE进行检查;
mix,平常使用PQping()进行检查,如果多次失败,最后一次使用已有连接执行 SELECT TRUE进行检查,否则一切正常。
可选参数:ping, connection, query, mix;默认为mix。
适用版本:
KingbaseES V8R6
1、集群架构及状态
# 节点信息
node1<------> 192.169.1.102
node2<------> 192.169.1.101
# 集群节点状态
[kingbase@node102 bin]$ ./repmgr cluster show
----+-------+---------+-----------+----------+----------+----------+----------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------
1 | node1 | standby | running | node2 | default | 100 | 2 | 0 bytes | host=192.168.1.102 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
2 | node2 | primary | * running | | default | 100 | 2 | | host=192.168.1.101 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
2、集群repmgr.conf配置
[kingbase@node102 bin]$ cat ../etc/repmgr.conf
use_scmd=off
ha_running_mode='DG'
node_id=1
node_name='node1'
conninfo='host=192.168.1.102 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3'
connection_check_type='mix'
.......
reconnect_attempts=2
reconnect_interval=5
默认connect_check_type参数:
3、模拟主库网卡down
[root@node101 ~]# ifdown enp0s3 && sleep 60 && ifup enp0s3
Device 'enp0s3' successfully disconnected.
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
4、查看备库hamgr.log日志
---如下图所示,failover切换完成,原备库被promote为新的主库。
切换日志信息:
standby被提升为新主库:
5、切换完成
# 在repmgr.conf中配置recovery='automatic',会完成原主库自动recovery为新备库加入到集群中;其他参数需要手工恢复。
[kingbase@node102 bin]$ ./repmgr cluster show
ID | Name | Role | Status | Upstream | Location | Priority | Timeline | LSN_Lag | Connection string
----+-------+---------+-----------+----------+----------+----------+----------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------
1 | node1 | primary | * running | | default | 100 | 3 | | host=192.168.1.102 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
2 | node2 | standby | running | node1 | default | 100 | 3 | 0 bytes | host=192.168.1.101 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
KingbaseES V8R6集群运维系列 -- connect_check_type参数的更多相关文章
- KingbaseES V8R6集群运维案例之---repmgr standby promote应用案例
案例说明: 在容灾环境中,跨区域部署的异地备节点不会自主提升为主节点,在主节点发生故障或者人为需要切换时需要手动执行切换操作.若主节点已经失效,希望将异地备机提升为主节点. $bin/repmgr s ...
- KingbaseES V8R6集群管理运维案例之---repmgr standby switchover故障
案例说明: 在KingbaseES V8R6集群备库执行"repmgr standby switchover"时,切换失败,并且在执行过程中,伴随着"repmr stan ...
- KingbaseES V8R6集群维护案例之---停用集群node_export进程
案例说明: 在KingbaseES V8R6集群启动时,会启动node_exporter进程,此进程主要用于向kmonitor监控服务输出节点状态信息.在系统安全漏洞扫描中,提示出现以下安全漏洞: 对 ...
- kingbaseES V8R6集群备份恢复案例之---备库作为repo主机执行物理备份
案例说明: 此案例是在KingbaseES V8R6集群环境下,当主库磁盘空间不足时,执行sys_rman备份,将集群的备库节点作为repo主机,执行备份,并将备份存储在备库的磁盘空间. 集群架构 ...
- KingbaseES V8R6集群维护之--修改数据库服务端口案例
案例说明: 对于KingbaseES数据库单实例环境,只需要修改kingbase.conf文件的'port'参数即可,但是对于KingbaseES V8R6集群中涉及到多个配置文件的修改,并且在应 ...
- KingbaseES V8R6集群外部备份案例
案例说明: 本案例采用sys_backup.sh执行物理备份,备份使用如下逻辑架构:集群采用CentOS 7系统,repo采用kylin V10 Server. 一主一备+外部备份 此场景为主备双机常 ...
- KingbaseES V8R6集群维护案例之--修改securecmdd工具服务端口
案例说明: 在一些生产环境,为了系统安全,不支持ssh互信,或限制root用户使用ssh登录,KingbaseES V8R6可以使用securecmdd工具支持主机之间的通讯.securecmdd工具 ...
- 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 ...
随机推荐
- 使用V2R做反向代理内网穿透
环境 内网服务器Prob1位于内网LAN1, 内网服务器Prob2位于内网LAN2, 外网服务器Serv1位于IP 123.123.123.123 内网节点配置 内网节点没有inbound,只需要配置 ...
- Js文件异步加载
Js文件异步加载 浏览器中渲染引擎与Js脚本引擎是互斥的,在浏览器开始渲染页面时,如果遇到<script>标签,会停止渲染当前页面,也就是说在脚本加载与执行的过程中会阻塞页面的渲染,在网速 ...
- SpringBoot使用git-commit-id-maven-plugin打包
简介 git-commit-id-maven-plugin 是一个maven 插件,用来在打包的时候将git-commit 信息打进jar中. 这样做的好处是可以将发布的某版本和对应的代码关联起来,方 ...
- 关于动态抽样(Dynamic Sampling)
关于动态抽样(Dynamic Sampling) 原文:http://www.oracle.com/technetwork/issue-archive/2009/09-jan/o19asktom-08 ...
- win32-ReadProcessMemory 的使用
std::vector<std::byte> ReadBytes(PVOID address, SIZE_T length) { std::vector<std::byte> ...
- (微服务)服务治理:熔断器介绍以及hystrix-go的使用
一.什么是熔断器 要理解熔断器,可以先看看电路中使用的保险丝. 保险丝(fuse)也被称为电流保险丝,IEC127 标准将它定义为"熔断体(fuse-link)".保险丝是一种保证 ...
- Flask遇到的坑及解决办法
flask_script 在使用第三方包flask_script时,报一下错误 ModuleNotFoundError: No module named 'flask._compat' 问题时flas ...
- 【Azure Compute Gallery】使用 Python 代码从 Azure Compute Gallery 复制 Image-Version
问题描述 Azure Compute Gallery 可以帮助围绕 Azure 资源(例如映像和应用程序)生成结构和组织,并且支持全局复制. 如果想通过Python代码实现 Image-Version ...
- 【Azure 环境】使用 az ad group create 时候遇见 Insufficient privileges to complete the operation
问题描述 使用China Azure,通过Azure CLI 创建AAD组报错,提示权限不足 Insufficient privileges to complete the operation # 使 ...
- hbase报错ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet 采坑记
1.错误异常信息: Exception in thread "main" java.lang.IllegalArgumentException: Failed to find me ...