Skip to content

Commit

Permalink
docs: Update and translate documentation. radondb#496
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke committed May 30, 2022
1 parent 8538f05 commit 3a456b4
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 1,732 deletions.
183 changes: 0 additions & 183 deletions docs/zh-cn/charts.md

This file was deleted.

104 changes: 40 additions & 64 deletions docs/zh-cn/deploy_backup_restore_s3.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# mysql-operator

## Quickstart for backup
Contents

Install the operator named `test`:
- [前提条件](#前提条件)
- [简介](#简介)
- [配置backup](#配置backup)
- [步骤 1: 添加 secret 文件](#1-添加-secret-文件)
- [步骤 2: 将 secret 配置到 Operator 集群](#2-将-secret-配置到-Operator-集群)
- [启动备份](#启动备份)
- [从备份副本恢复到新集群](#从备份副本恢复到新集群)

```shell
helm install test charts/mysql-operator
```
## 前提条件

* 已部署 [RadonDB MySQL 集群](kubernetes/deploy_radondb-mysql_operator_on_k8s.md)

## 简介

### configure backup
本文档介绍如何对部署的 RadonDB MySQL Operator 集群进行备份和恢复。

add the secret file
## 配置backup

### 1. 添加 secret 文件
```yaml
kind: Secret
apiVersion: v1
Expand All @@ -25,15 +34,18 @@ data:
type: Opaque

```
s3-xxxx value is encode by base64, you can get like that
```shell
echo -n "hello"|base64
s3-xxxx 值用 base64 编码,注意不要把换行符编码进去, 可以用如下命令获取base64编码:
```
echo -n "替换为您的S3-XXX值"|base64
```
then, create the secret in k8s.
随后, 用如下命令创建备份secret:

```
kubectl create -f config/samples/backup_secret.yaml
```
Please add the backupSecretName in mysql_v1alpha1_mysqlcluster.yaml, name as secret file:
### 2. 将 secret 配置到 Operator 集群
将备份secret名称添加到mysql_v1alpha1_mysqlcluster.yaml中, 本例中名称为sample-backup-secret:

```yaml
spec:
replicas: 3
Expand All @@ -50,78 +62,42 @@ metadata:
name: backup-sample1
spec:
# Add fields here
hostname: sample-mysql-0
clustername: sample
hostName: sample-mysql-0
clusterName: sample

```
| name | function |
|------|--------|
|hostname|pod name in cluser|
|clustername|cluster name|
|hostName| 集群中Pod的名称 |
|clusterName| 数据库集群名称 |

### start cluster

```shell
kubectl apply -f config/samples/mysql_v1alpha1_mysqlcluster.yaml
```
### start backup
After run cluster success
## 启动备份
启动集群后,才可以进行备份操作
```shell
kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml
```

## Uninstall

Uninstall the cluster named `sample`:

```shell
kubectl delete mysqlclusters.mysql.radondb.com sample
```

Uninstall the operator name `test`:

```shell
helm uninstall test
kubectl delete -f config/samples/mysql_v1alpha1_backup.yaml
执行成功后, 可以通过如下命令查看备份状况
```

Uninstall the crd:

```shell
kubectl delete customresourcedefinitions.apiextensions.k8s.io mysqlclusters.mysql.radondb.com
kubectl get backups.mysql.radondb.com
NAME BACKUPNAME BACKUPDATE TYPE
backup-sample sample_2022526155115 2022-05-26T15:51:15 S3
```

## 从备份副本恢复到新集群
检查您的 s3 bucket, 得到您需要的备份文件夹如 `sample_2022526155115`.
添加 RestoreFrom 字段到 mysql_v1alpha1_backup.yaml 中, 如下:

## restore cluster from backup copy
check your s3 bucket, get the directory where your backup to, such as `backup_2021720827`.
add it to RestoreFrom in yaml file
```yaml
...
spec:
replicas: 3
mysqlVersion: "5.7"
backupSecretName: sample-backup-secret
restoreFrom: "backup_2021720827"
restoreFrom: "sample_2022526155115"
...
```
Then you use:
随后, 启动集群, 将会从备份文件夹中恢复数据库.:
```shell
kubectl apply -f config/samples/mysql_v1alpha1_mysqlcluster.yaml
```
could restore a cluster from the `backup_2021720827 ` copy in the S3 bucket.


## build your own image
such as :
```
docker build -f Dockerfile.sidecar -t acekingke/sidecar:0.1 . && docker push acekingke/sidecar:0.1
docker build -t acekingke/controller:0.1 . && docker push acekingke/controller:0.1
```
you can replace acekingke/sidecar:0.1 with your own tag

## deploy your own manager
```shell
make manifests
make install
make deploy IMG=acekingke/controller:0.1 KUSTOMIZE=~/radondb-mysql-kubernetes/bin/kustomize
```
192 changes: 0 additions & 192 deletions docs/zh-cn/deploy_monitoring.md

This file was deleted.

16 changes: 8 additions & 8 deletions docs/zh-cn/deploy_radondb-mysql_operator_on_k8s_offline.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Contents
# Contents

- [在 Kubernetes 上离线部署 RadonDB MySQL 集群](#在-kubernetes-上离线部署-radondb-mysql-集群)
- [简介](#简介)
Expand Down Expand Up @@ -36,16 +36,16 @@ RadonDB MySQL 支持在 Kubernetes 上安装部署和管理,自动执行与运

### 步骤 1: 准备部署资源

```shell
## 下载离线部署资源
wget https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/radondb-mysql-resources.tar.gz
#### 下载离线部署资源
从docker hub 下载镜像`radondb/mysql-operator, radondb/mysql57-sidecar, radondb/mysql80-sidercar,percona/percona-server:5.7.34, percona/percona-server:8.0.25`, 放入到各个worker节点


## 解压
tar -xvzf radondb-mysql-resources.tar.gz
#### 导入镜像(需要在每个运行数据库的 worker 上执行)

## 导入镜像(需要在每个运行数据库的 worker 上执行)
ls radondb-mysql-resources/images/*.tar|awk '{print $NF}'|sed -r 's#(.*)#sudo docker load -i \1#' |bash
```
docker load -i XXXX
```
将XXXX 替换为以上下载的镜像文件名

### 步骤 2: 部署 Operator

Expand Down
12 changes: 6 additions & 6 deletions docs/zh-cn/rebuild.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Why need rebuild ?
RadonDB cluster is semisynchronous replication mysql cluster. Because MySQL Semisynchronous Replication, It has a chance that the slave has more data than master, So when the xenon check it, It will lable the pod INVALID. When it happend, You
need rebuild the INVALID pod.
# 为什么需要 rebuild ?

# How to use ?
Before you want to rebuild the pod, you need to manually check the security and consistency of the cluster.
RadonDB 集群是一种半同步的MySQL复制集群, 由于半同步复制存在机会使得slave的数据更新量比master多, 因此当xenon检查到INVALID pod时, 需要重新构建INVALID pod.

# 如何使用 ?
在执行 rebuild 之前, 请手动检查集群数据是否一致, 并且确认 rebuild 动作是安全的

```shell
./hack/rebuild.sh PODNAME
```
**for example**
**例子**
```shell
./hack/rebuild.sh sample-mysql-2
```
Loading

0 comments on commit 3a456b4

Please sign in to comment.