# Magma 缩容 Magma 缩容原理如下,把需要删除的节点当成掉线节点处理,之后会在其他节点补齐分片副本,最终每个节点承载更多的分片,完成缩容操作。 ![](../_static/magma-scale-in.png) ## 使用限制 - Magma 集群至少需要配置为三副本 - Magma 集群缩容后节点数至少为副本数,例如三副本要求缩容后至少为三节点。 ## 缩容步骤 这里以缩容 vsc_catalog 一个节点 n4 为例,修改配置文件 `magma-topology.yaml` 中 vsc_catalog 的 nodes 配置,删除节点4, 修改为 'nodes: n3,n2,n1' 。 ``` nodes: - id: n3 addr: 10.0.197.104 label: { region: "regionB", zone: "zoneC"} - id: n1 addr: 10.0.197.88 label: { region: "regionB", zone: "zoneC"} - id: n2 addr: 10.0.193.107 label: { region: "regionB", zone: "zoneC"} - id: n4 addr: 10.0.193.127 label: { region: "regionB", zone: "zoneC"} vsc: - name: vsc_catalog nodes: n3,n2,n1,n4 port: 6666 num_ranges: 12 num_replicas: 3 data_dir: /data1/oushudb/magma_vsc_catalog_segment replica_locations: "regionB.zoneC:3" leader_preferences: "regionB.zoneC" ``` 执行 `magma reload vscluster --vsc=vsc_catalog` ,如还需继续缩容,通过 `magma status` 确认 Magma 可服务后再删除下一个节点。