Skip to content

Commit

Permalink
docs(2.2.2): added docs for 2.2.2 (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored Aug 6, 2024
1 parent 15a1c56 commit b960534
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The following table describes the parameters.
| spec.observer.storage.dataStorage | Required. The data storage size for OBServer nodes. |
| spec.observer.storage.redoLogStorage | Required. The clog storage size for OBServer nodes. |
| spec.observer.storage.logStorage | Required. The runtime log storage size for OBServer nodes. |
| spec.observer.storage.*.storageClass | Required. The storage class required for creating a PersistentVolumeClaim (PVC). This parameter takes effect on storage configurations. |
| spec.observer.storage.*.storageClass | Optional. The storage class required for creating a PersistentVolumeClaim (PVC). Set to default storageClass in kubernetes cluster if leaving it empty. This parameter takes effect on storage configurations. |
| spec.observer.storage.*.size | Required. The size of the created PVC. This parameter takes effect on storage configurations. |
| spec.monitor | Optional. The monitoring configuration. We recommend that you enable this parameter. ob-operator uses obagent to collect monitoring data. You can connect ob-operator to Prometheus to monitor the status of the OceanBase cluster. |
| spec.monitor.image | Required. The image used for monitoring. |
Expand All @@ -149,7 +149,7 @@ The following table describes available annotations. For short, the annotation `
| Annotation | Description |
| -- | -- |
| `independent-pvc-lifecycle` | `true`: Require ob-operator >= 2.1.1. PVCs won't be deleted even if the OBCluster is deleted. |
| `mode` | `standalone`: Require ob-operator >= 2.1.1 and observer version >= 4.2.0. Bootstrap the single-node cluster with 127.0.0.1, which cannot contact other nodes any more. <br/> `service`: Require ob-operator >= 2.2.0 and observer version >= 4.2.3. Create a specific K8s service for each OBServer and use the service's `ClusterIP` as the OBServer's IP address. |
| `mode` | `standalone`: Require ob-operator >= 2.1.1 and observer version >= 4.2.0. Bootstrap the single-node cluster with 127.0.0.1, which cannot contact other nodes any more. <br/> `service`: Require ob-operator >= 2.2.0 and observer version >= 4.2.1.4 excepting 4.2.2.x. Create a specific K8s service for each OBServer and use the service's `ClusterIP` as the OBServer's IP address. |
| `single-pvc` | `true`: Require ob-operator >= 2.1.2. Create and bind a single PVC to a OBServer pod (three PVCs by default). |

### Create a cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,30 @@ After the cluster is created and running, we may need to adjust the resource con

## Scale up: Modify CPU and memory resources

<main id="notice" type='notice'>
<h4>Notes</h4>
<p>Only the <code>standalone</code> mode cluster supports this operation.</p>
</main>
:::note
Only cluster of the `standalone` or `service` mode supports this operation.
:::

Assuming that we have created a single-node standalone cluster with a resource specification of 2C+10G. The configuration in YAML format is as follows:

```yaml
observer:
# ...
resource:
cpu: 2
memory: 10Gi
# ...
observer:
# ...
resource:
cpu: 2
memory: 10Gi
# ...
```

If you find that the resources are insufficient after running for a period of time and need to be expanded, you can directly modify this part of the configuration. For example, in the following YAML fragment, we have expanded the resource specification of the OBServer to 4C+16G.

```yaml
observer:
# ...
resource:
cpu: 4
memory: 16Gi
# ...
observer:
# ...
resource:
cpu: 4
memory: 16Gi
# ...
```

Upon modifying the YAML, apply it to the Kubernetes cluster. ob-operator will then perform the cluster's scale-up expansion. Once the OBCluster transitions back to a `running` state, the expansion is complete.
Expand All @@ -50,47 +49,46 @@ test running xxx

## Dynamically expand PVC

<main id="notice" type='notice'>
<h4>Notes</h4>
<p>This operation requires that the storage class used by the cluster supports the <code>AllowVolumeExpansion</code> feature.</p>
</main>
:::note
This operation requires that the storage class used by the cluster supports the `AllowVolumeExpansion` feature.
:::

Assuming that we have deployed an OBCluster, the storage configuration is shown in the following YAML fragment:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 50Gi
redoLogStorage:
storageClass: my-storage
size: 50Gi
logStorage:
storageClass: my-storage
size: 20Gi
# ...
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 50Gi
redoLogStorage:
storageClass: my-storage
size: 50Gi
logStorage:
storageClass: my-storage
size: 20Gi
# ...
```

To expand the mounted volume, increase the `size` value in the YAML fragment and apply the changes via kubectl. ob-operator will handle the PVC expansion. Note that `size` can only be increased.

After modification, the configuration is as follows:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 60Gi
redoLogStorage:
storageClass: my-storage
size: 60Gi
logStorage:
storageClass: my-storage
size: 30Gi
# ...
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 60Gi
redoLogStorage:
storageClass: my-storage
size: 60Gi
logStorage:
storageClass: my-storage
size: 30Gi
# ...
```

```shell
Expand All @@ -104,3 +102,46 @@ test expand pvc xxx
test running xxx
```

## Modify the storage class for running cluster

If you need to change the storage class of the running cluster, you can modify the storage class in the OBCluster YAML configuration and apply the changes via kubectl. ob-operator will handle the migration one server by one server.

Assuming that we have deployed an OBCluster, the storage configuration is shown in the following YAML fragment:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 60Gi
redoLogStorage:
storageClass: my-storage
size: 60Gi
logStorage:
storageClass: my-storage
size: 30Gi
# ...
```

To change the storage class, modify the `storageClass` value in the YAML fragment and apply the changes via kubectl. What value should be modified to depends on the actual situation. In the following example, we change the storage class to `new-storage`.

After modification, the configuration is as follows:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: new-storage
size: 60Gi
redoLogStorage:
storageClass: new-storage
size: 60Gi
logStorage:
storageClass: new-storage
size: 30Gi
# ...
```

In order to ensure the stability of the cluster, ob-operator will roll out the migration one server by one server. Only after a server is successfully migrated will the next server be migrated. The migration process will not affect the cluster's overall availability, but it may affect the cluster's performance. Therefore, it is recommended to perform this operation during off-peak hours.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ spec:
| spec.observer.storage.dataStorage | OceanBase 中的 observer 的数据存储配置; 必填。 |
| spec.observer.storage.redoLogStorage | OceanBase 中的 observer 的 clog 存储配置; 必填。 |
| spec.observer.storage.logStorage | OceanBase 中的 observer 的运行日志存储配置; 必填。 |
| spec.observer.storage.*.storageClass | 对于存储配置生效,用于定义创建 pvc 使用的 storageClass; 必填|
| spec.observer.storage.*.storageClass | 对于存储配置生效,用于定义创建 pvc 使用的 storageClass; 选填,如果留空会被设置为 k8s 集群中的默认存储类|
| spec.observer.storage.*.size | 对于存储配置生效,用于定义创建 pvc 的容量; 必填。 |
| spec.monitor | 监控配置, 建议开启,ob-operator 会使用 obagent 来做监控数据采集,通过对接 prometheus 可以实现对 OceanBase 的状态监控; 选填。 |
| spec.monitor.image | 监控所使用的镜像; 必填。 |
Expand All @@ -147,7 +147,7 @@ spec:
| 注解 | 说明 |
| -- | -- |
| `independent-pvc-lifecycle` | `true`: 要求 ob-operator >= 2.1.1。可在删除集群后保留 PVC |
| `mode` | `standalone`: 要求 ob-operator >= 2.1.1,observer 版本 >= 4.2.0。使用 127.0.0.1 初始化单节点集群,无法与其他节点通信 <br/> `service`: 要求 ob-operator >= 2.2.0,observer 版本 >= 4.2.3。为每个 OBServer 创建单独的 K8s Service,用 Service 的 `ClusterIP` 作为 OBServer 的通讯 IP |
| `mode` | `standalone`: 要求 ob-operator >= 2.1.1,observer 版本 >= 4.2.0。使用 127.0.0.1 初始化单节点集群,无法与其他节点通信 <br/> `service`: 要求 ob-operator >= 2.2.0,observer 版本 >= 4.2.1.4 但不等于 4.2.2.x。为每个 OBServer 创建单独的 K8s Service,用 Service 的 `ClusterIP` 作为 OBServer 的通讯 IP |
| `single-pvc` | `true`: 要求 ob-operator >= 2.1.2。为每个 OBServer 的 Pod 创建并绑定一个整体的 PVC(默认创建三个) |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ sidebar_position: 6.5

## 垂直拓展:修改 CPU 和内存资源

<main id="notice" type='notice'>
<h4>注意</h4>
<p>仅有 <code>standalone</code> 模式的集群支持本操作</p>
</main>
:::note
仅有 `standalone``service` 模式的集群支持本操作。
:::

假设我们目前已经创建了一个单节点 Standalone 集群,节点资源规格为 2C+10G,该配置在 YAML 配置中应该如下片段所示。

Expand Down Expand Up @@ -50,10 +49,9 @@ test running xxx

## 动态扩容 PVC

<main id="notice" type='notice'>
<h4>注意</h4>
<p>该操作要求集群存储使用的存储类支持 <code>AllowVolumeExpansion</code> 特性</p>
</main>
:::note
该操作要求集群存储使用的存储类支持 `AllowVolumeExpansion` 特性。
:::

假设我们目前已经部署了一个 OB 集群,其存储配置如下 YAML 片段所示:

Expand Down Expand Up @@ -104,4 +102,46 @@ test expand pvc xxx
test expand pvc xxx
...
test running xxx
```
```

## 修改运行中集群的存储类

如果需要修改运行中集群的存储类,可以修改 OBCluster YAML 配置中的存储类,并通过 kubectl 应用这些修改。ob-operator 将逐个 OBServer 地进行迁移。

假设我们已经部署了一个集群,存储配置如下 YAML 片段所示:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: my-storage
size: 60Gi
redoLogStorage:
storageClass: my-storage
size: 60Gi
logStorage:
storageClass: my-storage
size: 30Gi
# ...
```

要修改存储类,可直接修改这个片段当中的 `storageClass` 值(具体设置为什么类型取决于实际情况,这里使用 `new-storage` 为例),并且通过 kubectl 应用到 K8s 集群当中。修改完成后的 YAML 配置如下所示:

```yaml
observer:
# ...
storage:
dataStorage:
storageClass: new-storage
size: 60Gi
redoLogStorage:
storageClass: new-storage
size: 60Gi
logStorage:
storageClass: new-storage
size: 30Gi
# ...
```

为了保障集群的稳定性,ob-operator 会逐个 OBServer 地进行迁移。只有在一个 OBServer 成功迁移后,才会进行下一个 OBServer 的迁移。迁移过程不会影响集群的整体可用性,但可能会影响集群的性能,因此建议在非高峰时段进行此操作。
29 changes: 23 additions & 6 deletions docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# 变更日志

## 2.2.1
## 2.2.2 (发布于 2024.06.18)

### 新增特性

1. 支持创建集群时给 `storageClass` 字段留空以使用默认存储类
2. 支持通过 `/pause-reconciling: "true"` 注解暂停 CRD 的调度,可能解决某些问题
3. 支持在运行中的 OBClusters 中更改存储类
4. 新增 CRD `OBClusterOperation` 用于对 OBClusters 进行常见运维操作

### 缺陷修复

1. 修复集群减半缩容后可能出现的失活问题(例如从 2-2-2 立即缩容为 1-1-1)

## 2.2.1 (发布于 2024.05.15)

### 新增特性

Expand All @@ -19,7 +32,7 @@
1. 部署集群前检查 Clog 存储卷兼容性
2. 优化服务模式下创建集群时的版本检查

## 2.2.0 (2024.03.28 发布)
## 2.2.0 (发布于 2024.03.28)

### 新增特性

Expand All @@ -36,7 +49,7 @@
1. 加速子资源发生变化时的资源调解过程
2. 通过 Prometheus 标准接口暴露 Controller Manager 的监控指标

## 2.1.2 版本 (2024.01.24 发布)
## 2.1.2 版本 (发布于 2024.01.24)

### 新增特性

Expand All @@ -58,7 +71,7 @@
4. 精简租户所需的用户凭证,root 和 standbyro 均为选填,standbyro 若不传递,会默认创建
5. 在创建集群的 Pod 之前等待所需镜像拉取到本地

## 2.1.1 版本 (2023.12.20 发布)
## 2.1.1 版本 (发布于 2023.12.20)

### 新增特性

Expand All @@ -76,25 +89,29 @@
1. 减少初始的 `datafile_size` 参数值,使用步进的方式按需增大数据文件磁盘用量
2. 加强资源规格校验,尤其针对 `OBCluster``OBTenant`

## 2.1.0 版本(2023.11.20 发布
## 2.1.0 版本(发布于 2023.11.20)

### 新增特性

1. 集群配置中新增亲和性和容忍性的选项
2. 支持从备份数据恢复出租户和创建备租户
3. 提供 ARM 架构镜像

### 缺陷修复

1. 修复 map 并发写可能出现的问题
2. 修复租户备份过程中使用过期的数据库连接的问题
3. 修复 OceanBase 4.2.1 SQL 语法兼容性问题

### 功能优化

1. 采用回退机制优化出错任务重试过程
2. 增加事件打印,优化日志输出

## 2.0.0 版本(2023.09.26 发布
## 2.0.0 版本(发布于 2023.09.26)

### 新增特性

1. 支持 OceanBase 集群的管理功能
2. 支持 OceanBase 租户的管理功能
3. 使用 obagent 来监控 OceanBase
Loading

0 comments on commit b960534

Please sign in to comment.