当前位置:网站首页>容器化 | 在 NFS 备份恢复 RadonDB MySQL 集群数据
容器化 | 在 NFS 备份恢复 RadonDB MySQL 集群数据
2022-08-04 17:41:00 【RadonDB】
社区于上个月发布了 RadonDB MySQL Kubernetes v2.2.0,集群数据备份恢复的存储类型除了 S3,新增 NFS 存储。本文将为您演示如何进行 NFS 备份及恢复操作。
环境准备
- Kubernetes 集群
- RadonDB MySQL 集群
过程略,详细请回顾《快速实现 MySQL 高可用集群部署》。
安装 NFS 服务与资源
方法一:使用 Helm 安装
helm install demo charts/mysql-operator --set nfsBackup.installServer=true --set nfsBackup.volume.createLocalPV=true或者手动创建 PVC,再执行
helm install demo charts/mysql-operator --set nfsBackup.installServer=true --set nfsBackup.volume.specifiedPVC=XXXX用该方法,可以在安装 Operator 时,也将 NFS 服务的 Pod 和 Service 安装到集群中。
方法二:使用 kubectl 安装
kubectl apply -f config/samples/nfs_pv.yaml kubectl apply -f config/samples/nfs_server.yaml获取 nfsServerAddress
例如:
kubectl get svc nfs-server --template={{.spec.clusterIP}}10.98.253.82获取到 ClusterIP,即可以使用该地址进行 NFS 备份。这里 IP 地址为 10.96.253.82。
创建 NFS 备份
配置 NFS 服务的地址
# 文件 config/samples/mysql_v1alpha1_backup.yamlnfsServerAddress: "10.96.253.82"创建备份
kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml注意:备份自定义资源与 MySQL 集群自定义资源必须在同一个命名空间中。
验证备份
使用如下命令,可以发现名称格式为 <cluster name>_<timestamp> 的备份文件夹。
kubectl exec -it <pod name of nfs server> -- ls /exports# 显示结果index.html initbackup sample_2022419101946备份恢复
从已有的 NFS 备份文件中恢复集群。配置 mysql_v1alpha1_cluster.yaml,将 nfsServerAddress 设置为 NFS 服务的地址。
...restoreFrom: "sample_2022419101946"nfsServerAddress: 10.96.253.82注意:
restoreFrom是备份路径的名称,可以从 NFS 服务加载的路径中看到。然后从 NFS 备份副本恢复集群,如下:
kubectl apply -f config/samples/mysql_v1alpha1_cluster.yaml恢复完成,已经从名为 sample_2022419101946 的 NFS 备份中恢复一个集群。
边栏推荐
猜你喜欢

餐饮供应链管理系统

知乎高赞:拼多多和国家电网,选哪个?
The second step through MySQL in four steps: MySQL index learning

【web自动化测试】Playwright快速入门,5分钟上手

学习探索-给字体设置前景色

【LeetCode每日一题】——374.猜数字大小

嵌入式开发:使用堆栈保护提高代码完整性
![[Web Automation Test] Quick Start with Playwright, 5 minutes to get started](/img/68/36dd8ef4a4073f03d5e5dad91be20d.png)
[Web Automation Test] Quick Start with Playwright, 5 minutes to get started

Create Sentinel high-availability cluster current limiting middleware from -99

开发一套高容错分布式系统
随机推荐
SRM Supplier Collaborative Management System Function Introduction
】 【 LeetCode daily one problem - 540. The order of a single element of the array
【技术积累】JS事件循环,Promise,async/await的运行顺序
SQL优化最全总结 - MySQL(2022最新版)
Create Sentinel high-availability cluster current limiting middleware from -99
【LeetCode每日一题】——374.猜数字大小
codeforces每日5题(均1600)-第二十八天
Digital-intelligent supply chain management system for chemical manufacturing industry: build a smart supply system and empower enterprises to improve production efficiency
动态数组底层是如何实现的
hi, 请问下这是什么问题, 我看官网的example就是mysql的, 咋提示不支持?
基于clipboard.js对复制组件的封装
Flutter实战-请求封装(四)之gzip报文压缩
php如何查询字符串以什么开头
【图像分类】2021-DeiT
【MySQL】数据库的4中隔离级别
Clearance sword refers to Offer——The sword refers to Offer II 010. and the sub-array of k
The use of QCompleter for Qt auto-completion
Boost library study notes (1) Installation and configuration
mmdetection/mmdetection3d多机多卡训练
Kotlin挂起函数原理是什么