主题
Doris 引擎扩容
Doris 引擎扩容指的是增加 doris BE 节点数量,扩容过程中不影响当前系统运行以及正在执行的任务,并且不会影响当前系统的性能。数据均衡会自动进行。根据集群现有数据量的大小,集群会在几个小时到1天不等的时间内,恢复到负载均衡的状态
增加机器扩容
扩容前新机器准备工作
横向扩容前需要在新机器上进行如下准备工作。
请参考引擎新节点环境准备完成新节点准备工作。
扩容操作
- 启动扩容节点 BE 服务
shell
$ ssh node2
hengshi@node1$ cd /opt/hengshi
hengshi@node1$ bin/hengshi-sense-bin start doris-be single
1
2
3
2
3
- 查看扩容节点 BE 服务启动状态
shell
$ ssh node2
hengshi@node1$ cd /opt/hengshi
hengshi@node1$ bin/hengshi-sense-bin status doris-be single
# 提示下列信息表示 BE 服务启动成功
[hengshi-sense-bin:48][ INFO ]: be status is started
1
2
3
4
5
2
3
4
5
- 将扩容节点 BE 服务增加到 doris 集群
shell
$ ssh node1
hengshi@node1$ bin/doris-client.sh
# 进入到 mysql 控制台 node2-host 为扩容节点的 ip 地址,
mysql> ALTER SYSTEM ADD BACKEND 'node2-host:9050';
mysql> show backends;
# 结果 Alive 字段类型为 true,表示节点增加成功,如果结果为 false,可能需要等待几分钟后再次执行 show backends;
+-----------+-----------------+--------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
| BackendId | Cluster | IP | HeartbeatPort | BePort | HttpPort | BrpcPort | LastStartTime | LastHeartbeat | Alive | SystemDecommissioned | ClusterDecommissioned | TabletNum | DataUsedCapacity | AvailCapacity | TotalCapacity | UsedPct | MaxDiskUsedPct | RemoteUsedCapacity | Tag | ErrMsg | Version | Status | HeartbeatFailureCounter | NodeRole |
+-----------+-----------------+--------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
| 10003 | default_cluster | node2-host | 9050 | 9060 | 8040 | 8060 | 2023-01-11 14:26:57 | 2023-06-02 10:35:03 | true | false | false | 680 | 33.526 MB | 416.611 GB | 433.784 GB | 3.96 % | 3.96 % | 0.000 | {"location" : "default"} | | doris-1.2.1-rc01-075c88e | {"lastSuccessReportTabletsTime":"2023-06-02 10:34:05","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} | 0 | mix |
+-----------+-----------------+--------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
# 如果反复查看结果仍然未变成 true,请联系技术人员支持。
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
- 修改衡石配置文件,增加扩容节点配置信息
shell
$ ssh node1
hengshi@node1$ cd /opt/hengshi/conf
hengshi@node1$ vi hengshi-sense-env.sh
# 修改 DORIS_BE_HOSTS 变量
export DORIS_BE_HOSTS=( `已部署 BE 节点 host` `node2-host` )
1
2
3
4
5
2
3
4
5
提示
数据均衡会自动进行。根据集群现有数据量的大小,集群会在几个小时到1天不等的时间内,恢复到负载均衡的状态