Storage 负载均衡¶
用户可以使用SUBMIT JOB BALANCE
语句平衡分片和 Raft leader 的分布,或者清空某些 Storage 服务器方便进行维护。详情请参见 SUBMIT JOB BALANCE。
Danger
SUBMIT JOB BALANCE
命令通过创建和执行一组子任务来迁移数据和均衡分片分布,禁止停止集群中的任何机器或改变机器的 IP 地址,直到所有子任务完成,否则后续子任务会失败。
均衡分片分布¶
Enterpriseonly
仅企业版支持均衡分片分布。
均衡 leader 分布¶
用户可以使用命令SUBMIT JOB BALANCE LEADER
均衡分布所有图空间中的 leader。
示例¶
nebula> SUBMIT JOB BALANCE LEADER;
用户可以执行SHOW HOSTS
检查结果。
nebula> SHOW HOSTS;
+------------------+------+----------+--------------+-----------------------------------+------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+----------+--------------+-----------------------------------+------------------------+---------+
| "192.168.10.100" | 9779 | "ONLINE" | 4 | "basketballplayer:3" | "basketballplayer:8" | "3.5.0" |
| "192.168.10.101" | 9779 | "ONLINE" | 8 | "basketballplayer:3" | "basketballplayer:8" | "3.5.0" |
| "192.168.10.102" | 9779 | "ONLINE" | 3 | "basketballplayer:3" | "basketballplayer:8" | "3.5.0" |
| "192.168.10.103" | 9779 | "ONLINE" | 0 | "basketballplayer:2" | "basketballplayer:7" | "3.5.0" |
| "192.168.10.104" | 9779 | "ONLINE" | 0 | "basketballplayer:2" | "basketballplayer:7" | "3.5.0" |
| "192.168.10.105" | 9779 | "ONLINE" | 0 | "basketballplayer:2" | "basketballplayer:7" | "3.5.0" |
+------------------+------+-----------+----------+--------------+-----------------------------------+------------------------+---------+
Caution
在NebulaGraph 3.5.0 中,Leader 切换会导致短时的大量请求错误(Storage Error E_RPC_FAILURE
),处理方法见 FAQ。
最后更新:
January 31, 2024