Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support changing cacheVolume of cn and dn after mo is deployed #1170

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,45 @@ NS="mo"
kubectl get pod -n "${NS}" -owide # 等待状态为 Running
```

### 动态扩容

Operator 支持 TN、CN 的 cacheVolume 配置动态扩容,不支持缩容操作,扩容过程前后,CN、TN pod 无需重启。具体步骤如下:

1. 确保 StorageClass 支持卷扩展功能

```bash
#获取 storageclass 信息
>kubectl get storageclass ${SC_NAME} -oyaml #SC_NAME 是 mo 集群使用的 pvc 的 sc 类型

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以提示一下,用这个命令可以查看STORAGE_CLASS的名称
[root@VM-0-122-tencentos ~]# kubectl get pvc -n ${MO_NS}
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mo-data-mo-customer-test-cnset1-cn-rhv55 Bound pvc-5b8ed11a-bd16-4003-9d2e-0b17de76e4b9 100Gi RWO cbs-hssd 3h10m
mo-data-mo-customer-test-cnset1-cn-sddmf Bound pvc-804f64c4-c167-45b4-b82c-7af966a36971 100Gi RWO cbs-hssd 3h10m
mo-data-mo-customer-test-dn-0 Bound pvc-86d35491-b18c-4ad6-a685-95da970d211c 50Gi RWO cbs-hssd 3h10m
mo-data-mo-customer-test-log-0 Bound pvc-b6888a78-c946-498c-935e-cd1ae333c11a 100Gi RWO cbs-hssd 3h11m
mo-data-mo-customer-test-log-1 Bound pvc-fad96b55-b55e-4768-a80b-1d8e6168a2db 100Gi RWO cbs-hssd 3h11m
mo-data-mo-customer-test-log-2 Bound pvc-12416574-e763-4124-bebf-033e69bd2838 100Gi RWO cbs-hssd 3h11m


#查看名为 cbs-hssd 的 StorageClass 对象的 YAML 配置,确保 StorageClass 支持卷扩展功能
>kubectl get storageclass cbs-hssd -oyaml | grep allowVolumeExpansion
allowVolumeExpansion: true
```

2. 进入集群配置编辑模式:

```bash
kubectl edit mo -n ${MO_NS} ${MO_NAME} # 其中 MO_NS 为部署 MO 集群的命名空间,MO_NAME 为 MO 集群的名称;例如 MO_NS=matrixone; MO_NAME=mo_cluster
```

3. 按需修改 tn 和 cn 的 cacheVolume 的 size 大小。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

视乎修改的对象:
1、如果为CN group,则修改spec.cnGroups[0].cacheVolume(或spec.cnGroups[1].cacheVolume,其中[n]中的n为CN Group的数组下标);
2、如果为CN,则修改spec.tp.cacheVolume
3、如果为TN,则修改spec.tn.cacheVolume(或spec.dn.cacheVolume

```bash
- cacheVolume:
size: 900Gi
```

然后保存并退出:按 esq 键,和:wq

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是英文的:


4. 查看扩容结果

```bash

>kubectl get pvc -n ${MO_NS}

>kubectl get pv
```

## 连接 MatrixOne 集群

为了连接 MatrixOne 集群,您需要将对应服务的端口映射到 MatrixOne 节点上。以下是使用 `kubectl port-forward` 连接 MatrixOne 集群的指导:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,45 @@ __Note:__ 本章节均是在 master0 节点操作。
mo-tp-cn-0 1/1 Running 0 50s
```

### 动态扩容

Operator 支持 TN、CN 的 cacheVolume 配置动态扩容,不支持缩容操作,扩容过程前后,CN、TN pod 无需重启。具体步骤如下:

1. 确保 StorageClass 支持卷扩展功能

```bash
#获取 storageclass 信息
>kubectl get storageclass ${SC_NAME} -oyaml #SC_NAME 是 mo 集群使用的 pvc 的 sc 类型

#查看名为 cbs-hssd 的 StorageClass 对象的 YAML 配置,确保 StorageClass 支持卷扩展功能
>kubectl get storageclass cbs-hssd -oyaml | grep allowVolumeExpansion
allowVolumeExpansion: true
```

2. 进入集群配置编辑模式:

```bash
kubectl edit mo -n ${MO_NS} ${MO_NAME} # 其中 MO_NS 为部署 MO 集群的命名空间,MO_NAME 为 MO 集群的名称;例如 MO_NS=matrixone; MO_NAME=mo_cluster
```

3. 按需修改 tn 和 cn 的 cacheVolume 的 size 大小。

```bash
- cacheVolume:
size: 900Gi
```

然后保存并退出:按 esq 键,和:wq

4. 查看扩容结果

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提示注意CAPACITY这个输出


```bash

>kubectl get pvc -n ${MO_NS}

>kubectl get pv

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubectl get pv | grep ${NS}

```

## 6. 连接 MatrixOne 集群

为了连接 MatrixOne 集群,您需要将对应服务的端口映射到 MatrixOne 节点上。以下是使用 `kubectl port-forward` 连接 MatrixOne 集群的指导:
Expand Down
Loading