KingbaseES V8R6集群同步模式synchronous参数配置详解
2024-09-07 05:53:07
如下图所示:
集群数据同步原理说明:
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 = ''
最新文章
- 搭建emacs的go编程语言环境
- java使用split分隔,需要注意的点
- Markdown常用基本语法
- 安装faac编译问题
- 使用httputils上传图片到服务器
- Extjs4使用iframe注意事项
- [HttpClient]SSL双向实例
- 获取json对象的长度
- 容器 list
- C++习题 复数类--重载运算符2+
- C#发送邮件类
- jQuery与js的length属性
- Halcon的应用程序 打开后 弹出没有帮助文件错误提示
- 利用WSUS部署更新程序
- Vue 2.6 中部分引入 TypeScript 的方法
- Robot Framework 遇到过的错误 1. Chrome打开无法数据网址,地址栏只显示data:,
- Delphi Class of 类引用
- MySQL存储过程的异常处理
- spring boot2.03 spring cloud Finchley.RELEASE遇到的问题
- Python学习之web框架 Flask
热门文章
- 针对elementUI 中InfiniteScroll按需引入的一点注意事项
- 使用Vite2+TypeScript4+Vue3技术栈,如何入手开发项目
- MySQL-5-TCL,视图,变量,存储过程和函数,流程控制
- 设计模式-策略模式前端应用校验vue写法
- 158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能
- C#中的 Attribute 与 Python/TypeScript 中的装饰器是同个东西吗
- 我看谁还说程序员不会P图?拜托~4行python代码就够~
- idea控制台不能输入问题
- Spring框架系列(11) - Spring AOP实现原理详解之Cglib代理实现
- rxjava回调地狱-kotlin协程来帮忙