[未完待续] PostgreSQL on ECS 高效率持续备份设计 - By ZFS on Linux
背景
设计
master1 -> standby on single ECS with multi-ssd云盘 … mastern -> standby on single ECS with multi-ssd云盘
zfs1_data (压缩+快照) zfs1_wal (压缩) … zfsn_data (压缩+快照) zfsn_wal (压缩)
demo
1、以CentOS 7.3为例,下载对应的rpm。
EL6 Package: http://download.zfsonlinux.org/epel/zfs-release.el6.noarch.rpm
EL7.3 Package: http://download.zfsonlinux.org/epel/zfs-release.el7_3.noarch.rpm
EL7.4 Package: http://download.zfsonlinux.org/epel/zfs-release.el7_4.noarch.rpm
实时更新,请看
https://github.com/zfsonlinux/zfs/wiki/RHEL-and-CentOS
yum install -y http://download.zfsonlinux.org/epel/zfs-release.el7_3.noarch.rpm
两种安装zfs的模式:
一种是与Linux分发版本内核完全匹配的模式(kABI-tracking kmod)
一种是任意内核版本的模式(kmod),推荐使用。 (一定要安装linux当前运行内核版本的kernel-devel)
找到对应的kernel-devel的方法
If your kernel is not listed by yum because it is in an older tree, you can download it manually from the CentOS Vault.
CentOS-7: Look in either the 7.N.YYMM/os/x86_64/Packages/ or the 7.N.YYMM/updates/x86_64/Packages/ directories for the kernel-devel-version.x86_64.rpm
CentOS-6: Look in either the 6.N/os/arch/Packages/ or the 6.N/updates/arch/Packages/ directories for the kernel-devel-version.arch.rpm
安装
uname -a
Linux izuf64ame76453g49tfw8pz 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
yum install -y http://vault.centos.org/7.3.1611/updates/x86_64/Packages/kernel-devel-3.10.0-514.26.2.el7.x86_64.rpm
yum install -y zfs
查看日志,是否有报错,正常情况下没有报错
测试是否可用
modprobe zfs
zfs get -o all
系统启动自动加载zfs
参考
https://github.com/zfsonlinux/zfs/wiki/RHEL-and-CentOS
《PostgreSQL 最佳实践 - 块级增量备份(ZFS篇)双机HA与块级备份部署》
《PostgreSQL 最佳实践 - 块级增量备份(ZFS篇)单个数据库采用多个zfs卷(如表空间)时如何一致性备份》
《PostgreSQL 最佳实践 - 块级增量备份(ZFS篇)备份集自动校验》
《PostgreSQL 最佳实践 - 块级增量备份(ZFS篇)方案与实战》
《zfs 快照增量恢复 vs PostgreSQL xlog增量恢复 速度》
《zfs 快照增量大小 vs PostgreSQL产生的XLOG大小》
《fast & safe upgrade to PostgreSQL 9.4 use pg_upgrade & zfs》