如下图所示:

集群数据同步原理说明:

synchronous参数配置测试:

集群节点信息:

ID | Name    | Role    | Status    | Upstream | repmgrd | PID   | Paused? | Upstream last seen
----+---------+---------+-----------+----------+---------+-------+---------+--------------------
1 | node101 | standby | running | node102 | running | 7345 | no | 1 second(s) ago
2 | node102 | primary | * running | | running | 13934 | no | n/a

数据库版本:

test=# select version();
version
----------------------------------------------------------------------------------------------------------------------
KingbaseES V008R006C005B0041 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
(1 row)

一、配置synchronous='sync'

1、配置synchronous参数

[kingbase@node102 bin]$ cat ../etc/repmgr.conf |grep sync
#synchronous='quorum'
synchronous='sync'

2、查看流复制同步状态

test=# select * from sys_stat_replication;
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time
-------+----------+---------+------------------+---------------+-----------------+-------------+-------------------------------+-------
10622 | 10 | system | node101 | 192.168.1.101 | | 19002 | 2022-04-27 00:29:19.703179+08 | | streaming | 0/400008E0 | 0/400008E0 | 0/400008E0 | 0/400008E0 | | | | 1 | sync | 2022-04-27 15:01:31.539178+08
(1 row)

3、查看kingbase.auto.conf配置

[kingbase@node102 bin]$ cat ../data/kingbase.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
enable_upper_colname = 'on'
primary_conninfo = 'user=system connect_timeout=10 host=192.168.1.101 port=54321 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3 application_name=node102'
recovery_target_timeline = 'latest'
primary_slot_name = 'repmgr_slot_2'
wal_retrieve_retry_interval = '5000'
synchronous_standby_names = '1 (node101)'

二、配置synchronous='quorum'(默认)

1、配置synchronous参数

[kingbase@node102 bin]$ cat ../etc/repmgr.conf |grep sync
synchronous='quorum'
#synchronous='sync'
#synchronous='async'

2、查看流复制同步状态

test=# select * from sys_stat_replication;
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time
-------+----------+---------+------------------+---------------+-----------------+-------------+-------------------------------+--------------+-----------+------------+------------+------------+------------+-----------+-----------+------------+---------------+------------+-------------------------------
16656 | 10 | system | node101 | 192.168.1.101 | | 19593 | 2022-04-27 00:37:24.155837+08 | | streaming | 0/42000960 | 0/42000960 | 0/42000960 | 0/42000960 | | | | 1 | quorum | 2022-04-27 15:09:06.702206+08
(1 row)

3、查看kingbase.auto.conf配置

[kingbase@node102 bin]$ cat ../data/kingbase.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
enable_upper_colname = 'on'
primary_conninfo = 'user=system connect_timeout=10 host=192.168.1.101 port=54321 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3 application_name=node102'
recovery_target_timeline = 'latest'
primary_slot_name = 'repmgr_slot_2'
wal_retrieve_retry_interval = '5000'
synchronous_standby_names = 'ANY 1(node101)'

三、配置synchronous='async'(默认)

1、配置synchronous参数

[kingbase@node102 bin]$ cat ../etc/repmgr.conf |grep sync
#synchronous='quorum'
#synchronous='sync'
synchronous='async'

2、查看流复制同步状态

test=# select * from sys_stat_replication;
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time
-------+----------+---------+------------------+---------------+-----------------+-------------+-------------------------------+--------------+-----------+------------+------------+------------+------------+-----------+-----------+------------+---------------+------------+-------------------------------
13720 | 10 | system | node101 | 192.168.1.101 | | 19317 | 2022-04-27 00:33:32.600138+08 | | streaming | 0/41000938 | 0/41000938 | 0/41000938 | 0/41000938 | | | | 0 | async | 2022-04-27 15:05:25.079617+08
(1 row)

3、查看kingbase.auto.conf配置

[kingbase@node102 bin]$ cat ../data/kingbase.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
enable_upper_colname = 'on'
primary_conninfo = 'user=system connect_timeout=10 host=192.168.1.101 port=54321 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3 application_name=node102'
recovery_target_timeline = 'latest'
primary_slot_name = 'repmgr_slot_2'
wal_retrieve_retry_interval = '5000'
synchronous_standby_names = ''

KingbaseES V8R6集群同步模式synchronous参数配置详解的更多相关文章

  1. Vmware在NAT模式下网络配置详解

    Vmware在NAT模式下网络配置详解 Linux中的网络配置对于接触Linux不久的小白菜来说,还是小有难度的,可能是不熟悉这种与windows系列迥然不同的命令行操作,也可能是由于对Linux的结 ...

  2. druid 参数配置详解

    druid 参数配置详解 */--> druid 参数配置详解 Table of Contents 1. 初始化连接 2. 参数配置及说明 3. 注意事项 3.1. 底层连接 3.2. 空闲检查 ...

  3. logback 常用参数配置详解

    logback 常用配置详解(二) <appender> <appender>: <appender>是<configuration>的子节点,是负责写 ...

  4. Nginx.conf参数配置详解

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx; #Nginx用户及组:用户 组.window下不指定 worker_processes 8; #工作进程:数 ...

  5. Spark 性能相关参数配置详解-任务调度篇

    随着Spark的逐渐成熟完善, 越来越多的可配置参数被添加到Spark中来, 本文试图通过阐述这其中部分参数的工作原理和配置思路, 和大家一起探讨一下如何根据实际场合对Spark进行配置优化. 由于篇 ...

  6. 深入剖析Redis系列: Redis集群模式搭建与原理详解

    前言 在 Redis 3.0 之前,使用 哨兵(sentinel)机制来监控各个节点之间的状态.Redis Cluster 是 Redis 的 分布式解决方案,在 3.0 版本正式推出,有效地解决了 ...

  7. HDFS之三:hdfs参数配置详解

    1.hdfs-site.xml 参数配置 – dfs.name.dir – NameNode 元数据存放位置 – 默认值:使用core-site.xml中的hadoop.tmp.dir/dfs/nam ...

  8. xheditor的参数配置详解

    2.2. 初始化参数列表 2.3. API函数接口列表 2.4. 上传程序开发规范 2.5. 插件开发指南 2.6. 皮肤设计指南 2.2. 初始化参数列表 初始化参数示例代码: $('#elm1') ...

  9. datatables参数配置详解

    //@translator codepiano //@blog codepiano //@email codepiano.li@gmail.com //尝试着翻译了一下,难免有错误的地方,欢迎发邮件告 ...

随机推荐

  1. JavaScript与Node.js一起打造一款聊天App

    聊天是我们人与人交流最直接的方式,互联网的加入使我们交流更加便捷.我们手机上的微信.QQ是我们手机必不可少的应用软件.那么,我们是否可以做一款聊天应用呢? 之前我自己闲着没事,研究过一些技术,做了一款 ...

  2. Vue MD5加密你用吗?

    安装 npm install --save js-md5 1.按需引入(在你需要的项目中引入) 引入: import md5 from 'js-md5' 使用: md5('加密信息') 2.全局引入( ...

  3. SpringBoot + JWT + Redis 开源知识社区系统

    「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识.准备 Java 面试,首选 JavaGuide!:https://javaguide.cn/ 你好,我是 Guide!这 ...

  4. Linux,Centos系统下配置java Jdk(附下载地址)

    一.下载jdk 官网下载地址:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html 需要登录Oracle ...

  5. MYSQL--安装2(命令行连接到数据库)

    使用命令行窗口连接 MYSQL 数据库[操作示意图]

  6. SpringBoot接口 - API接口有哪些不安全的因素?如何对接口进行签名?

    在以SpringBoot开发后台API接口时,会存在哪些接口不安全的因素呢?通常如何去解决的呢?本文主要介绍API接口有不安全的因素以及常见的保证接口安全的方式,重点实践如何对接口进行签名.@pdai ...

  7. Python网页解析库:用requests-html爬取网页

    Python网页解析库:用requests-html爬取网页 1. 开始 Python 中可以进行网页解析的库有很多,常见的有 BeautifulSoup 和 lxml 等.在网上玩爬虫的文章通常都是 ...

  8. .NET Core 实现后台任务(定时任务)Longbow.Tasks 组件(三)

    原文链接:https://www.cnblogs.com/ysmc/p/16512309.html 在上两篇文章中,简单介绍了怎么使用 IHostedService 与 BackgroundServi ...

  9. 算法竞赛进阶指南0x35高斯消元与线性空间

    高斯消元 目录 高斯消元 ACWing207. 球形空间产生器(点击访问) 求解思路 代码 ACWing208. 开关问题(点击访问) 思路 代码 总结 欣赏 线性空间 定义 ACWing209. 装 ...

  10. C# 基础知识-反射

    一.反射 1>反射的命名空间是System.Reflection 2>是.Net框架提供的帮助类库,读取并使用matedata 二.反射基本用法 举例如下 1>Assembly as ...