Skip to content

Commit

Permalink
doc: translate and update docs. radondb#564 (radondb#565)
Browse files Browse the repository at this point in the history
* doc: proofread zh-cn md files

* doc: translate and proofread docs.
  • Loading branch information
hayleyling authored Jul 1, 2022
1 parent 7811491 commit 3174643
Show file tree
Hide file tree
Showing 31 changed files with 1,240 additions and 371 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# What is RadonDB MySQL

**RadonDB MySQL** is an open-source, cloud-native, and high-availability cluster solution based on MySQL. It supports the architecture of a primary database and multiple secondary databases, with a full set of management functions for security, automatic backup, monitoring and alarming, and automatic capacity expansion, and so on.
**RadonDB MySQL** is an open-source, cloud-native, and high-availability cluster solution based on MySQL. It supports the architecture of one leader node and multiple replicas, with a set of management functions for security, automatic backup, monitoring and alarming, automatic scaling, and so on.

**RadonDB MySQL Kubernetes** supports installation, deployment and management of RadonDB MySQL clusters on [Kubernetes](https://kubernetes.io/), [KubeSphere](https://kubesphere.com.cn/) and [Rancher](https://rancher.com), and automates tasks involved in running a RadonDB MySQL cluster.

Expand Down Expand Up @@ -71,12 +71,12 @@

## Steps

### Step 1: Add a Helm repository
### Step 1: Add a Helm repository.

```plain
helm repo add radondb https://radondb.github.io/radondb-mysql-kubernetes/
```
### Step 2: Install Operator
### Step 2: Install Operator.

Set the release name to `demo` and create a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) named `demo-mysql-operator`.

Expand All @@ -87,7 +87,7 @@ helm install demo radondb/mysql-operator
> This step also creates the [CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) required by the cluster.
### Step 3: Deploy a RadonDB MySQL Cluster
### Step 3: Deploy a RadonDB MySQL Cluster.

Run the following command to create an instance of the `mysqlclusters.mysql.radondb.com` CRD and thereby create a RadonDB MySQL cluster by using the default parameters. To customize the cluster parameters, see [Configuration Parameters](https://github.com/radondb/radondb-mysql-kubernetes/blob/main/docs/zh-cn/config_para.md).

Expand All @@ -100,7 +100,7 @@ kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/la
* [Deploy RadonDB MySQL on Kubernetes](https://github.com/radondb/radondb-mysql-kubernetes/blob/main/docs/en-us/deploy_radondb-mysql_operator_on_k8s.md)
* [Deploy RadonDB MySQL on KubeSphere](https://github.com/radondb/radondb-mysql-kubernetes/blob/main/docs/en-us/deploy_radondb-mysql_operator_on_kubesphere.md)
* [Deploy RadonDB MySQL on Rancher](https://github.com/radondb/radondb-mysql-kubernetes/blob/main/docs/en-us/deploy_radondb-mysql_operator_on_rancher.md)
* [All Documents](https://radondb.com/en/docs/mysql/)
* [All documents](https://radondb.com/en/docs/mysql/)


# Who are using RadonDB MySQL
Expand Down
21 changes: 14 additions & 7 deletions docs/en-us/DebugMode.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Debug Mode
When you want avoid the restart-on-fail loop for mysql container, You should use Debug Mode.
it just use create a empty file `/var/lib/mysql/sleep-forever`
for example:
English | [简体中文](../zh-cn/DebugMode.md)

Contents
===========
* [Debug mode](#debug-mode)
* [Remove the debug mode](#remove-the-debug-mode)

# Enable the debug mode
To avoid the restart-on-fail loop of mysql container in O&M, enable the debug mode. You need to create an empty file `/var/lib/mysql/sleep-forever` as follows.

```bash
kubectl exec -it sample-mysql-0 -c mysql -- sh -c 'touch /var/lib/mysql/sleep-forever'
```
it make pod sample-mysql-0's mysql container will never restart when mysqld is crashed.
As a result, the MySQL container in the `sample-mysql-0` pod will never restart when the mysqld crashes.

# Remove Debug Mode
# Remove the debug mode

```bash
kubectl exec -it sample-mysql-0 -c mysql -- sh -c 'rm /var/lib/mysql/sleep-forever'
```
restart the container

As a result, the MySQL container in the `sample-mysql-0` pod will restart after mysqld exits.
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
## 如何创建自己的镜像
English | [简体中文](../zh-cn/build_and_use_images.md)

## How to build and use images
* [Operator](#operator)
* [Sidecar](#sidecar)
* [Sidecar](#sidecar)

### Operator

1. 创建自己的镜像并上传到docker hub上.
1. Build an operator image and push it to Docker Hub.

```
docker build -t {your repo}/mysql-operator:{your tag} . && docker push {your repo}/mysql-operator:{your tag}
```

2. 添加 radondb mysql 的 helm 库.
2. Add the Helm repository of RadonDB MySQL.

```
helm repo add radondb https://radondb.github.io/radondb-mysql-kubernetes/
```

3. 使用自己的镜像来安装/更新 operator.
3. Install/Update the operator using the image.

```
helm upgrade demo radondb/mysql-operator --install --set manager.image={your repo}/mysql-operator --set manager.tag={your tag}
```

### Sidecar

1. 创建自己的 sidecar 镜像并 push 到 docker hub 中.
1. Build a sidecar image and push it to Docker Hub.

```
docker build -f Dockerfile.sidecar -t {your repo}/mysql-sidecar:{your tag} . && docker push {your repo}/mysql-sidecar:{your tag}
```

2. 创建sample cluster.
2. Create a sample cluster.

```
kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/mysql_v1alpha1_mysqlcluster.yaml
```

3. 从已有的 cluster 中应用自己的镜像.
3. Apply the image to the cluster.

```
kubectl patch mysql sample -p '{"spec": {"podPolicy": {"sidecarImage": "{your repo}/mysql-sidecar:{your tag}"}}}' --type=merge
```

> 本例中集群名称为 `sample`, 您可以修改为您自己的集群名称.
> You can use your own cluster name to replace `sample`.
58 changes: 58 additions & 0 deletions docs/en-us/config_para.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
English | [简体中文](../zh-cn/config_para.md)

Contents
=============

* [Parameter Configuration](#parameter-configuration)
* [Container](#Container)
* [Pod](#pod)
* [Persistence](#Persistence)

# Parameter Configuration

## Container

| Parameter | Description | Default |
| :--------------------------------- | :-------------------------- | :---------------------------------------------------------- |
| MysqlVersion | MySQL version | 5.7 |
| MysqlOpts.RootPassword | MySQL root user password | "" |
| MysqlOpts.User | Default MySQL username | radondb_usr |
| MysqlOpts.Password | Default MySQL user password | RadonDB@123 |
| MysqlOpts.Database | Default database name | radondb |
| MysqlOpts.InitTokuDB | TokuDB enabled | true |
| MysqlOpts.MysqlConf | MySQL configuration | - |
| MysqlOpts.Resources | MySQL container resources | Reserve: CPU 100M, memory 256Mi; </br> limit: CPU 500M, memory 1Gi |
| XenonOpts.Image | Xenon (HA MySQL) image | radondb/xenon:1.1.5-alpha |
| XenonOpts.AdmitDefeatHearbeatCount | Maximum heartbeat failures allowed | 5 |
| XenonOpts.ElectionTimeout | Election timeout period (milliseconds) | 10000 ms |
| XenonOpts.Resources | Xenon container resources | Reserve: CPU 50M, memory 128Mi; </br> limit: CPU 100M, memory 256Mi |
| MetricsOpts.Enabled | Metrics (monitor) container enabled | false |
| MetricsOpts.Image | Metrics container image | prom/mysqld-exporter:v0.12.1 |
| MetricsOpts.Resources | Metrics container resources | Reserve: CPU 10M, memory 32Mi; </br>limit: CPU 100M, memory 128Mi |

## Pod

| Parameter | Description | Default |
| :-------------------------- | :----------------------------------------------- | :------------------------ |
| Replicas | The number of cluster nodes. The value 0, 2, 3 and 5 are allowed. | 3 |
| PodPolicy.ImagePullPolicy | The image pull policy is only allowed to be Always/IfnNotPresent/Never. | IfNotPresent |
| PodPolicy.Labels | Pod [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | - |
| PodPolicy.Annotations | Pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | - |
| PodPolicy.Affinity | Pod [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) | - |
| PodPolicy.PriorityClassName | Pod [priority](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/) class name | - |
| PodPolicy.Tolerations | Pod [toleration](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) list | - |
| PodPolicy.SchedulerName | Pod [scheduler](https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/) name | - |
| PodPolicy.ExtraResources | Node resources (containers except MySQL and Xenon) | Reserve: CPU 10M, memory 32Mi |
| PodPolicy.SidecarImage | Sidecar image | radondb/mysql-sidecar:latest |
| PodPolicy.BusyboxImage | Busybox image | busybox:1.32 |
| PodPolicy.SlowLogTail | SlowLogTail enabled | false |
| PodPolicy.AuditLogTail | AuditLogTail enabled | false |

## Persistence

| Parameter | Description | Default |
| :----------------------- | :------------- | :------------ |
| Persistence.Enabled | Persistence enabled | true |
| Persistence.AccessModes | Access mode | ReadWriteOnce |
| Persistence.StorageClass | Storage class | - |
| Persistence.Size | Size | 10Gi |
84 changes: 41 additions & 43 deletions docs/en-us/deploy_backup_restore_nfs.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,84 @@
# Quickstart for NFS backup
## Install NFS server
English | [简体中文](../zh-cn/deploy_backup_restore_nfs.md)

### 1. Prepare Storage
# Quickstart for NFS backups

Create the NFS PV and SC.
## Contents

```
kubectl apply -f config/samples/nfs_pv.yaml
```
* [Install NFS server and resources](#install-nfs-server-and-resources)
* [1. Install by Helm](#1-install-by-helm)
* [2. Install by kubectl](#2-install-by-kubectl)
* [Obtain `nfsServerAddress`](#obtain-nfsserveraddress)
* [Create an NFS backup](#create-an-nfs-backup)
* [1. Configure the NFS server address](#1-configure-the-nfs-server-address)
* [2. Create a backup](#2-create-a-backup)
* [3. Verify the backup](#3-verify-the-backup)
* [Restore the cluster from the NFS backup](#restore-the-cluster-from-the-nfs-backup)

> You can specify the PVC you created by modifying the `persistentVolumeClaim.claimName` in the `config/samples/nfs_server.yaml`.
### 2. Create nfs server

Create ReplicationController and Service.
## Install NFS server and resources

### 1. Install by Helm
```shell
helm install demo charts/mysql-operator --set nfsBackup.installServer=true --set nfsBackup.volume.createLocalPV=true
```
kubectl apply -f config/samples/nfs_server.yaml
Or manually create the PVC and run:
```shell
helm install demo charts/mysql-operator --set nfsBackup.installServer=true --set nfsBackup.volume.specifiedPVC=XXXX
```
> `XXX` stands for the PVC name.
Get `NFSServerAddress`.
In this way, you can install the Pod and Service of the NFS server in the cluster while installing the operator.

### 2. Install by kubectl
```shell
kubectl apply -f config/samples/nfs_pv.yaml
kubectl apply -f config/samples/nfs_server.yaml
```
# example

## Obtain `nfsServerAddress`
For example:
```shell

kubectl get svc nfs-server --template={{.spec.clusterIP}}
10.96.253.82
```
You can use `ClusterIp` to perform NFS backup. The cluster IP address in the example is `10.96.253.82`.

## Create a NFS backup

### 1. Configure address of NFS Server.
## Create an NFS backup
### 1. Configure the NFS server address

```yaml
# config/samples/mysql_v1alpha1_backup.yaml
nfsServerAddress: "10.96.253.82"
```
### 2. Create a backup
```shell
kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml
```
> Note: The backup CRD and MySQL cluster CRD must be in the same namespace.
> Notice: backup cr and mysqlcluster cr must be in the same namespace.
### 3. Verify your backup

You can find the backup folder called `<cluster name>_<timestamp>`.
### 3. Verify the backup
View the backup directory `<cluster name>_<timestamp>` as follows.

```
kubectl exec -it <pod name of nfs server> -- ls /exports
index.html initbackup sample_2022419101946
```

## Restore cluster from exist NFS backup
## Restore the cluster from the NFS backup

Configure the `mysql_v1alpha1_cluster.yaml`, uncomment the `nfsServerAddress` field and fill in your own configuration.
Configure the `nfsServerAddress` attribute to the NFS server address in the `mysql_v1alpha1_cluster.yaml` file.

```yaml
...
restoreFrom: "sample_2022419101946"
nfsServerAddress: 10.96.253.82
```
> Notice: restoreFrom is the folder name of a backup. You can find it on the path mounted in NFS Server.
> Notice: `restoreFrom` stands for the pathname of the backup. You can get it by checking the path loaded by the NFS server.

Create cluster from NFS server backup copy:
Restore cluster from NFS backup as follows.

```
kubectl apply -f config/samples/mysql_v1alpha1_cluster.yaml
```

## Build your own image

```
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
```
```
Loading

0 comments on commit 3174643

Please sign in to comment.