---
title: 集群切换UCX组网
description: "在使能UCX之前，需要配置UCX参数以及所有节点的配置文件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC5/sds/kunpengucx_16_0014.html
sourcePath: /source/zh/kunpengboostkithistory/240RC5/sds/kunpengucx_16_0014.html
indexId: a71b6a11f4703e6e224946486e8e9ef5371fd2230d1ac30aa5d14f4dd224395d68
---
# 集群切换UCX组网

在使能UCX之前，需要配置UCX参数以及所有节点的配置文件。

1. 进入Ceph集群容器。
  1 cephadm shell

2. 配置UCX参数。
  1 2 3 4 5 ceph config set global ms_type async+ucx ceph config set global ms_public_type async+ucx ceph config set global ms_cluster_type async+ucx ceph config set global ms_async_ucx_device mlx5_bond_0:1 ceph config set global ms_async_ucx_tls rc_verbs,self

3. 在所有节点（ceph1/ceph2/ceph3）中mon的配置文件，增加如下配置。

```
/var/lib/ceph/fsid/mon*/config
ms_type = async+ucx
ms_public_type = async+ucx
ms_cluster_type = async+ucx
ms_async_ucx_device=mlx5_bond_0:1
ms_async_ucx_tls=rc_verbs,self
```


  ms_async_ucx_device中的设备名称通过show_gids查看UCX设备名称，可配置多个网络设备。 当前配置为public网络保持POSIX不变，cluster网络使用UCX。要在前端网络使能UCX，只需要将ms_public_type=async+ucx。 cluster_network和public_network的IP地址应与UCX设备（RoCE/IB网口）的IP地址一致。 ms_async_ucx_event_polling设置为true，代表开启事件轮询（选配）。 ms_async_ucx_zerocopy设置为true，代表开启零拷贝（选配）。 ms_async_rdma_polling_us代表ucx每次查询事件的时间（选配，6000000）。

4. 在所有节点中将MON的修改同步到MGR和OSD，执行如下。

```
ls /var/lib/ceph/*/*/config|grep 'osd\|mgr'|xargs -I {} cp -r /var/lib/ceph/*/mon.*/config {}
```


5. 修改service文件。

```
sed -i 's/on-failure/always/g' /etc/systemd/system/ceph-*\@.service
sed -i 's/30min/1min/g' /etc/systemd/system/ceph-*\@.service
```


6. 重启Ceph集群。
  1 2 systemctl daemon-reload systemctl restart ceph.target

7. 待所有容器启动完成后，需重新进入Ceph集群容器查看集群状态。
  1 2 cephadm shell ceph -s
