跳转至

Storage 负载均衡Graph

用户可以使用BALANCE语句平衡分片和 Raft leader 的分布,或者清空某些 Storage 服务器方便进行维护。详情请参见 Graph。

历史版本兼容性

不支持BALANCE DATA命令。

均衡 leader 分布Graph

用户可以使用命令BALANCE LEADER均衡 leader 分布。

示例Graph

nebula> 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.0.0" |
| "192.168.10.101" | 9779 | "ONLINE" | 8            | "basketballplayer:3"              | "basketballplayer:8"   | "3.0.0" |
| "192.168.10.102" | 9779 | "ONLINE" | 3            | "basketballplayer:3"              | "basketballplayer:8"   | "3.0.0" |
| "192.168.10.103" | 9779 | "ONLINE" | 0            | "basketballplayer:2"              | "basketballplayer:7"   | "3.0.0" |
| "192.168.10.104" | 9779 | "ONLINE" | 0            | "basketballplayer:2"              | "basketballplayer:7"   | "3.0.0" |
| "192.168.10.105" | 9779 | "ONLINE" | 0            | "basketballplayer:2"              | "basketballplayer:7"   | "3.0.0" |
+------------------+------+----------+--------------+-----------------------------------+------------------------+---------+

Caution

在 NebulaGraph 3.0.0 中,Leader 切换会导致短时的大量请求错误(Storage Error E_RPC_FAILURE),处理方法见 Graph。


最后更新: February 8, 2022