diff --git a/docs/img/backup-and-restore-configure-backuprepo-minio.png b/docs/img/backup-and-restore-configure-backuprepo-minio.png new file mode 100644 index 00000000000..c8df5b8897b Binary files /dev/null and b/docs/img/backup-and-restore-configure-backuprepo-minio.png differ diff --git a/docs/node_modules/.yarn-integrity b/docs/node_modules/.yarn-integrity new file mode 100644 index 00000000000..20d6d48814b --- /dev/null +++ b/docs/node_modules/.yarn-integrity @@ -0,0 +1,10 @@ +{ + "systemParams": "darwin-arm64-108", + "modulesFolders": [], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [], + "lockfileEntries": {}, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/docs/user_docs/backup-and-restore/backup/backup-repo.md b/docs/user_docs/backup-and-restore/backup/backup-repo.md index 73246bc8624..354bbe0c91c 100644 --- a/docs/user_docs/backup-and-restore/backup/backup-repo.md +++ b/docs/user_docs/backup-and-restore/backup/backup-repo.md @@ -65,225 +65,260 @@ You can specify the BackupRepo information in a YAML configuration file when ins If you do not configure the BackupRepo information when installing KubeBlocks, you can manually configure it by the following instructions. -1. Install S3 CSI driver. +### Before you start + +There are various ways to create a BackupRepo. Make sure you have done all the necessary preparations before creating it. If you want to use MinIO, you need to make the following configurations in advance. + +1. Install MinIO. + + ```bash + helm install minio oci://registry-1.docker.io/bitnamicharts/minio + ``` + To get initial username and password, try the following. + + ```bash + # Initial username + echo $(kubectl get secret --namespace default minio -o jsonpath="{.data.root-user}" | base64 -d) + + # Initial password + echo $(kubectl get secret --namespace default minio -o jsonpath="{.data.root-password}" | base64 -d) + ``` + +2. Generate credentials. + + Access the login page by running `kubectl port-forward --namespace default svc/minio 9001:9001` and then accessing `127.0.0.1:9001`. + + Once you are logged in to the dashboard, you can generate an `access key` and `secret key`. + + ![MinIO dashboard](./../../../img/backup-and-restore-configure-backuprepo-minio.png) + +### Install S3 CSI driver + + + + + +```bash +# Enable the CSI-S3 add-on +kbcli addon enable csi-s3 + +# You can add flags to customize the installation of this add-on +# CSI-S3 install a daemonSet Pod on all nodes by default and you can set tolerations to install it on the specified node +kbcli addon enable csi-s3 \ + --tolerations '[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"true"}]' \ + --tolerations 'daemonset:[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"true"}]' + +# View the status of CSI-S3 driver and make sure it is Enabled +kbcli addon list csi-s3 +``` + + + + + +```bash +helm repo add kubeblocks https://jihulab.com/api/v4/projects/85949/packages/helm/stable +helm install csi-s3 kubeblocks/csi-s3 --version=0.6.0 -n kb-system + +# You can add flags to customize the installation of this add-on +# CSI-S3 install a daemonSet Pod on all nodes by default and you can set tolerations to install it on the specified node +--set-json tolerations='[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"taintValue"}]' +--set-json daemonsetTolerations='[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"taintValue"}]' +``` + + + + + +### Create BackupRepo + + + + - + ```bash - # Enable the CSI-S3 add-on - kbcli addon enable csi-s3 + kbcli backuprepo create my-repo \ + --provider s3 \ + --region cn-northwest-1 \ + --bucket test-kb-backup \ + --access-key-id \ + --secret-access-key \ + --default + ``` - # You can add flags to customize the installation of this add-on - # CSI-S3 install a daemonSet Pod on all nodes by default and you can set tolerations to install it on the specified node - kbcli addon enable csi-s3 \ - --tolerations '[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"true"}]' \ - --tolerations 'daemonset:[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"true"}]' + - # View the status of CSI-S3 driver and make sure it is Enabled - kbcli addon list csi-s3 + + + ```bash + kbcli backuprepo create my-repo \ + --provider oss \ + --region cn-zhangjiakou \ + --bucket test-kb-backup \ + # --endpoint https://oss-cn-zhangjiakou-internal.aliyuncs.com \ To display the specified oss endpoint + --access-key-id \ + --secret-access-key \ + --default + ``` + + + + + + ```bash + kbcli backuprepo create my-repo \ + --provider minio \ + --endpoint \ + --bucket test-minio \ + --access-key-id \ + --secret-access-key \ + --default + ``` + + + + + + The above command creates a default backup repository `my-repo`. + + * `my-repo` is the name of the created backup repository. If you do not specify a name, the system creates a random name, following the format `backuprepo-xxxxx`. + * `--default` means that this repository is set as the default repository. Note that there can only be one default global repository. If there exist multiple default repositories, KubeBlocks cannot decide which one to use (similar to the default StorageClass of Kubernetes), which further results in backup failure. Using `kbcli` to create BackupRepo can avoid such problems because `kbcli` checks whether there is another default repository before creating a new one. + * `--provider` specifies the storage type, i.e. `storageProvider`, and is required for creating a BakcupRepo. The available values are `s3`, `oss`, and `minio`. Parameters for different storage providers vary and you can run `kbcli backuprepo create --provider STORAGE-PROVIDER-NAME -h` to view the flags for different storage providers. + + After `kbcli backuprepo create` is executed successfully, the system creates the K8s resource whose type is `BackupRepo`. You can modify the annotation of this resource to adjust the default repository. + + ```bash + # Canel the default repository + kubectl annotate backuprepo old-default-repo \ + --overwrite=true \ + dataprotection.kubeblocks.io/is-default-repo=false + ``` + + ```bash + # Set a new default repository + kubectl annotate backuprepo backuprepo-4qms6 \ + --overwrite=true \ + dataprotection.kubeblocks.io/is-default-repo=true + ``` + + + + + + `kubectl` is another option to create a BackupRepo, but the commands do not include parameter and default repository verification compared with kbcli, which is not convenient. + + + + + + ```bash + # Create a secret to save the access key for S3 + kubectl create secret generic s3-credential-for-backuprepo \ + -n kb-system \ + --from-literal=accessKeyId= \ + --from-literal=secretAccessKey= + + # Create the BackupRepo resource + kubectl apply -f - <<-'EOF' + apiVersion: dataprotection.kubeblocks.io/v1alpha1 + kind: BackupRepo + metadata: + name: my-repo + annotations: + dataprotection.kubeblocks.io/is-default-repo: "true" + spec: + storageProviderRef: s3 + pvReclaimPolicy: Retain + volumeCapacity: 100Gi + config: + bucket: test-kb-backup + endpoint: "" + mountOptions: --memory-limit 1000 --dir-mode 0777 --file-mode 0666 + region: cn-northwest-1 + credential: + name: s3-credential-for-backuprepo + namespace: kb-system + EOF ``` - + ```bash - helm repo add kubeblocks https://jihulab.com/api/v4/projects/85949/packages/helm/stable - helm install csi-s3 kubeblocks/csi-s3 --version=0.6.0 -n kb-system + # Create a secret to save the access key for OSS + kubectl create secret generic oss-credential-for-backuprepo \ + -n kb-system \ + --from-literal=accessKeyId= \ + --from-literal=secretAccessKey= + + # Create the BackupRepo resource + kubectl apply -f - <<-'EOF' + apiVersion: dataprotection.kubeblocks.io/v1alpha1 + kind: BackupRepo + metadata: + name: my-repo + annotations: + dataprotection.kubeblocks.io/is-default-repo: "true" + spec: + storageProviderRef: s3 + pvReclaimPolicy: Retain + volumeCapacity: 100Gi + config: + bucket: test-kb-backup + mountOptions: "" + endpoint: "" + region: cn-zhangjiakou + credential: + name: oss-credential-for-backuprepo + namespace: kb-system + EOF + ``` + + - # You can add flags to customize the installation of this add-on - # CSI-S3 install a daemonSet Pod on all nodes by default and you can set tolerations to install it on the specified node - --set-json tolerations='[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"taintValue"}]' - --set-json daemonsetTolerations='[{"key":"taintkey","operator":"Equal","effect":"NoSchedule","value":"taintValue"}]' + + + ```bash + # Create a secret to save the access key for MinIO + kubectl create secret generic minio-credential-for-backuprepo \ + -n kb-system \ + --from-literal=accessKeyId= \ + --from-literal=secretAccessKey= + + # Create the BackupRepo resource + kubectl apply -f - <<-'EOF' + apiVersion: dataprotection.kubeblocks.io/v1alpha1 + kind: BackupRepo + metadata: + name: my-repo + annotations: + dataprotection.kubeblocks.io/is-default-repo: "true" + spec: + storageProviderRef: minio + pvReclaimPolicy: Retain + volumeCapacity: 100Gi + config: + bucket: test-kb-backup + mountOptions: "" + endpoint: + credential: + name: minio-credential-for-backuprepo + namespace: kb-system + EOF ``` -2. Create BackupRepo. - - - Use kbcli - - - - - - ```bash - kbcli backuprepo create my-repo \ - --provider s3 \ - --region cn-northwest-1 \ - --bucket test-kb-backup \ - --access-key-id \ - --secret-access-key \ - --default - ``` - - - - - - ```bash - kbcli backuprepo create my-repo \ - --provider oss \ - --region cn-zhangjiakou \ - --bucket test-kb-backup \ - # --endpoint https://oss-cn-zhangjiakou-internal.aliyuncs.com \ To display the specified oss endpoint - --access-key-id \ - --secret-access-key \ - --default - ``` - - - - - - ```bash - kbcli backuprepo create my-repo \ - --provider minio \ - --endpoint \ - --bucket test-minio \ - --access-key-id \ - --secret-access-key \ - --default - ``` - - - - - - The above command creates a default backup repository `my-repo`. - - * `my-repo` is the name of the created backup repository. If you do not specify a name, the system creates a random name, following the format `backuprepo-xxxxx`. - * `--default` means that this repository is set as the default repository. Note that there can only be one default global repository. If there exist multiple default repositories, KubeBlocks cannot decide which one to use (similar to the default StorageClass of Kubernetes), which further results in backup failure. Using `kbcli` to create BackupRepo can avoid such problems because `kbcli` checks whether there is another default repository before creating a new one. - * `--provider` specifies the storage type, i.e. `storageProvider`, and is required for creating a BakcupRepo. The available values are `s3`, `oss`, and `minio`. Parameters for different storage providers vary and you can run `kbcli backuprepo create --provider STORAGE-PROVIDER-NAME -h` to view the flags for different storage providers. - - After `kbcli backuprepo create` is executed successfully, the system creates the K8s resource whose type is `BackupRepo`. You can modify the annotation of this resource to adjust the default repository. - - ```bash - # Canel the default repository - kubectl annotate backuprepo old-default-repo \ - --overwrite=true \ - dataprotection.kubeblocks.io/is-default-repo=false - ``` - - ```bash - # Set a new default repository - kubectl annotate backuprepo backuprepo-4qms6 \ - --overwrite=true \ - dataprotection.kubeblocks.io/is-default-repo=true - ``` - - - Use kubectl - - `kubectl` is another option to create a BackupRepo, but the commands do not include parameter and default repository verification compared with kbcli, which is not convenient. - - - - - - ```bash - # Create a secret to save the access key for S3 - kubectl create secret generic s3-credential-for-backuprepo \ - -n kb-system \ - --from-literal=accessKeyId= \ - --from-literal=secretAccessKey= - - # Create the BackupRepo resource - kubectl apply -f - <<-'EOF' - apiVersion: dataprotection.kubeblocks.io/v1alpha1 - kind: BackupRepo - metadata: - name: my-repo - annotations: - dataprotection.kubeblocks.io/is-default-repo: "true" - spec: - storageProviderRef: s3 - pvReclaimPolicy: Retain - volumeCapacity: 100Gi - config: - bucket: test-kb-backup - endpoint: "" - mountOptions: --memory-limit 1000 --dir-mode 0777 --file-mode 0666 - region: cn-northwest-1 - credential: - name: s3-credential-for-backuprepo - namespace: kb-system - EOF - ``` - - - - - - ```bash - # Create a secret to save the access key for OSS - kubectl create secret generic oss-credential-for-backuprepo \ - -n kb-system \ - --from-literal=accessKeyId= \ - --from-literal=secretAccessKey= - - # Create the BackupRepo resource - kubectl apply -f - <<-'EOF' - apiVersion: dataprotection.kubeblocks.io/v1alpha1 - kind: BackupRepo - metadata: - name: my-repo - annotations: - dataprotection.kubeblocks.io/is-default-repo: "true" - spec: - storageProviderRef: s3 - pvReclaimPolicy: Retain - volumeCapacity: 100Gi - config: - bucket: test-kb-backup - mountOptions: "" - endpoint: "" - region: cn-zhangjiakou - credential: - name: oss-credential-for-backuprepo - namespace: kb-system - EOF - ``` - - - - - - ```bash - # Create a secret to save the access key for minIO - kubectl create secret generic minio-credential-for-backuprepo \ - -n kb-system \ - --from-literal=accessKeyId= \ - --from-literal=secretAccessKey= - - # Create the BackupRepo resource - kubectl apply -f - <<-'EOF' - apiVersion: dataprotection.kubeblocks.io/v1alpha1 - kind: BackupRepo - metadata: - name: my-repo - annotations: - dataprotection.kubeblocks.io/is-default-repo: "true" - spec: - storageProviderRef: minio - pvReclaimPolicy: Retain - volumeCapacity: 100Gi - config: - bucket: test-kb-backup - mountOptions: "" - endpoint: - credential: - name: minio-credential-for-backuprepo - namespace: kb-system - EOF - ``` - - - - + + + ## (Optional) Change the backup repository for a cluster diff --git a/docs/user_docs/kubeblocks-for-mysql/configuration/configuration.md b/docs/user_docs/kubeblocks-for-mysql/configuration/configuration.md index 63f0f72b7e2..2181ac77583 100644 --- a/docs/user_docs/kubeblocks-for-mysql/configuration/configuration.md +++ b/docs/user_docs/kubeblocks-for-mysql/configuration/configuration.md @@ -38,9 +38,11 @@ You can also view the details of this configuration file and parameters. * View the user guide of a specified parameter. ```bash - kbcli cluster explain-config mysql-cluster --param=innodb_buffer_pool_size + kbcli cluster explain-config mysql-cluster --param=innodb_buffer_pool_size --config-spec=mysql-consensusset-config ``` + `--config-spec` is required to specify a configuration template since ApeCloud MySQL currently supports multiple templates. You can run `kbcli cluster describe-config mysql-cluster` to view the all template names. +
Output @@ -204,18 +206,18 @@ The following steps take configuring MySQL Standalone as an example. :::note -* ApeCloud MySQL currently supports multiple configuration templates, so `--config-spec` is required. +* `--config-spec` is required to specify a configuration template since ApeCloud MySQL currently supports multiple templates. You can run `kbcli cluster describe-config mysql-cluster` to view the all template names. * If there are multiple components in a cluster, use `--component` to specify a component. ::: -2. View the status of the parameter configuration. +1. View the status of the parameter configuration. ```bash kbcli cluster describe-ops xxx -n default ``` -3. Connect to the database to verify whether the parameters are configured as expected. +2. Connect to the database to verify whether the parameters are configured as expected. ```bash kbcli cluster connect mysql-cluster diff --git a/docs/yarn.lock b/docs/yarn.lock new file mode 100644 index 00000000000..fb57ccd13af --- /dev/null +++ b/docs/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +