数据库版本:

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)

1、数据库软件安装路径

=此版本的软件安装路径和前面的版本相比有了较大变化,通过软链接可以在一个父目录下建立多个版本的软件=

[kingbase@node1 V8R6C5_41]$ ls -lh
total 0
lrwxrwxrwx 1 kingbase kingbase 68 Mar 21 15:04 ClientTools -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/ClientTools/
lrwxrwxrwx 1 kingbase kingbase 60 Mar 21 15:04 doc -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/doc/
lrwxrwxrwx 1 kingbase kingbase 64 Mar 21 15:04 install -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/install/
lrwxrwxrwx 1 kingbase kingbase 66 Mar 21 15:04 Interface -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Interface/
drwxrwxr-x 3 kingbase kingbase 30 Mar 21 15:02 KESRealPro
lrwxrwxrwx 1 kingbase kingbase 67 Mar 21 15:04 KingbaseHA -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/KingbaseHA/
lrwxrwxrwx 1 kingbase kingbase 67 Mar 21 15:04 license.dat -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/license.dat
lrwxrwxrwx 1 kingbase kingbase 63 Mar 21 15:04 Server -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/
lrwxrwxrwx 1 kingbase kingbase 65 Mar 21 15:04 SupTools -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/SupTools/
lrwxrwxrwx 1 kingbase kingbase 66 Mar 21 15:04 Uninstall -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Uninstall/

2、配置归档

[root@node1 data]# cat kingbase.conf |grep -i archive_
archive_mode = on # enables archiving; off, on, or always
archive_command='export TZ=Asia/Shanghai;/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_rman --config /home/kingbase/kbbr6_repo/sys_rman.conf --stanza=kingbase archive-push %p'

3、配置备份配置文件

[kingbase@node1 bin]$ cat sys_backup.conf
#file: sys_backup.conf
#dest dir: <cluster_dir>/kingbase/bin/sys_backup.conf
#dest dir: <cluster_dir>/kingbase/share/sys_backup.conf # target db style enum: single/cluster
_target_db_style="single"
# one kingbase node IP
# just provide one IP, script will use 'repmgr cluster show' get other node IP
_one_db_ip="127.0.0.1"
# local repo IP, inner-REPO, means repo located in one db node
# outer repo IP, outer-REPO, means repo located in outer node
_repo_ip="127.0.0.1"
# label of this cluster
_stanza_name="kingbase"
# OS user name of database
_os_user_name="kingbase"
# !!!! dir to store the backup files
# should be accessable for the OS user
_repo_path="/home/kingbase/kbbr6_repo"
# count of keep, over the count FULL-backup will be remove
_repo_retention_full_count=5
# count of days, interval to do FULL-backup
_crond_full_days=7
# count of days, interval to do DIFF-backup
_crond_diff_days=0
# count of days, interval to do INCR-backup
_crond_incr_days=1
# HOUR to do the FULL-backup
_crond_full_hour=2
# HOUR to do the DIFF-backup
_crond_diff_hour=3
# HOUR to do the INCR-backup
_crond_incr_hour=4
# band witdh limit, fixed in Mb/s, default 0 means no limit
_band_width=0
# OS cmd define
_os_ip_cmd="/sbin/ip"
_os_rm_cmd="/bin/rm"
_os_sed_cmd="/bin/sed"
_os_grep_cmd="/bin/grep"
# !!! these follow 4 parameter ONLY for single style
# data dir of single
_single_data_dir="/data/kingbase/v8r6c5_041/data"
# bin dir of single
_single_bin_dir="/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin"
# database user of single
_single_db_user="system"
# database port of single
_single_db_port="54321" # on means sys_securecmd, off means normal ssh
_use_scmd=on

4、执行备份的初始化

[kingbase@node1 bin]$ ./sys_backup.sh init
Please input password ...
# generate single sys_rman.conf...DONE
# update single archive_command with sys_rman.archive-push...DONE
# create stanza and check...(maybe 60+ seconds)
# create stanza and check...DONE
# initial first full backup...(maybe several minutes)
# initial first full backup...DONE
# Initial sys_rman OK.

5、查看初始化后备份目录及配置文件

[kingbase@node1 bin]$ ls -lh /home/kingbase/kbbr6_repo/
total 4.0K
drwxr-x--- 3 kingbase kingbase 21 Mar 21 15:46 archive
drwxr-x--- 3 kingbase kingbase 21 Mar 21 15:46 backup
-rw-rw-r-- 1 kingbase kingbase 539 Mar 21 15:46 sys_rman.conf #配置文件
[kingbase@node1 bin]$ cat /home/kingbase/kbbr6_repo/sys_rman.conf
# Genarate by script at 20220321154646, should not change manually
[kingbase]
kb1-path=/data/kingbase/v8r6c5_041/data
kb1-port=54321
kb1-user=system [global]
repo1-path=/home/kingbase/kbbr6_repo
repo1-retention-full=5
log-path=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/log
log-level-file=info
log-level-console=info
log-subprocess=y
process-max=4
#### default gz, support: gz none
compress-type=gz
compress-level=3
band-width=0
cmd-ssh=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_securecmd

6、查看备份日志

[kingbase@node1 log]$ cat sys_rman_stanza-create.log

2022-03-21 15:46:47.031 P00   INFO: stanza-create command begin 2.27: --cmd-ssh=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_securecmd --config=/home/kingbase/kbbr6_repo/sys_rman.conf --exec-id=28484-a4317ee9 --kb1-path=/data/kingbase/v8r6c5_041/data --kb1-port=54321 --kb1-user=system --log-level-console=info --log-level-file=info --log-path=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/log --log-subprocess --repo1-path=/home/kingbase/kbbr6_repo --stanza=kingbase
2022-03-21 15:46:48.196 P00 INFO: stanza-create for stanza 'kingbase' on repo1
2022-03-21 15:46:49.295 P00 INFO: stanza-create command end: completed successfully (2267ms)

7、备份故障案例分析

故障现象:

故障分析:

1)查看sys_backup.conf配置

2)检查数据库归档配置

故障原因:

8、总结

1)最新版本的软件安装目录存储方式有较大的变化
2)执行ssh跨节点访问,专门的命令:sys_securecmd
3)在备份前,需要检查下kingbase.conf中归档的配置

最新文章

  1. iOS实现UICollectionViewDataSource与Controller的分离
  2. web项目log4j的配置模板
  3. JsonPropertyOrder无法为DTO对象进行属性排序
  4. bzoj 1014 splay维护hash值
  5. HTML基础(3)
  6. MySQL数据库8 -子查询,联合查询
  7. C++中的虚函数(表)实现机制以及用C语言对其进行的模拟实现
  8. RequireJS 文件合并压缩
  9. Android安全问题 钓鱼程序
  10. Android的那些轮子
  11. SVN遇到Can&#39;t convert string from &#39;UTF-8&#39; to native encoding
  12. Hadoop 学习笔记 (十一) MapReduce 求平均成绩
  13. 杭电 HDU 4608 I-number
  14. RapidMiner的基本使用(一个医疗数据的简单决策树算法分析)
  15. 面向对象程序设计-C++_课时11new &amp; delete
  16. opatch auto in windows db in 11.2.0.4
  17. 输入输出系统--I/O接口
  18. We Talk -- 团队博客
  19. P3003 [USACO10DEC]苹果交货Apple Delivery
  20. 【GDOI】【图论-最短路】时间与空间之旅

热门文章

  1. Vue搭建后台系统需要做的几点(持续更新中)
  2. 集成学习——GBDT(手推公式)
  3. jenkins配置自动执行sql脚本
  4. Sentinel-流量防卫兵
  5. Tapdata Cloud 2.1.4 来啦:数据连接又上新,PolarDB MySQL、轻流开始接入,可自动标记不支持的字段类型
  6. APISpace 让你快速获取安徒生童话故事
  7. typescript关于postgres数据库的API封装
  8. Sharding-jdbc 5.1.2案例
  9. 笔记本Usb接口案例
  10. Ubu18开机自启动-Systemd