BE 节点的扩容和缩容过程,不影响当前系统运行以及正在执行的任务,并且不会影响当前系统的性能。数据均衡会自动进行。根据集群现有数据量的大小,集群会在几个小时到1天不等的时间内,恢复到负载均衡的状态。
(1)命令ALTER SYSTEM ADD BACKEND
MySQL [(none)]> ALTER SYSTEM ADD BACKEND "10.17.12.158:9050";
Query OK, 0 rows affected (0.02 sec)
MySQL [(none)]> ALTER SYSTEM ADD BACKEND "10.17.12.159:9050";
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]>
(2)查看BE状态,两个BE节点尚未链接
MySQL [(none)]> SHOW PROC '/backends'\G
*************************** 1. row ***************************
BackendId: 10093
Cluster: default_cluster
IP: 10.17.12.158
HostName: node1
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: N/A
LastHeartbeat: N/A
Alive: false
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: .000
AvailCapacity: 1.000 B
TotalCapacity: .000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
ErrMsg: java.net.ConnectException: 拒绝连接 (Connection refused)
Version:
*************************** 2. row ***************************
BackendId: 10092
Cluster: default_cluster
IP: 10.17.12.159
HostName: node2
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: N/A
LastHeartbeat: N/A
Alive: false
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: .000
AvailCapacity: 1.000 B
TotalCapacity: .000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
ErrMsg: java.net.ConnectException: 拒绝连接 (Connection refused)
Version:
*************************** 3. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 10.17.12.160
HostName: node3
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-12 10:38:34
LastHeartbeat: 2021-08-12 11:08:54
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 40
DataUsedCapacity: 5.991 KB
AvailCapacity: 7.813 GB
TotalCapacity: 49.090 GB
UsedPct: 84.09 %
MaxDiskUsedPct: 84.09 %
ErrMsg:
Version: 0.12.0-rc03-Unknown
3 rows in set (0.02 sec)
MySQL [(none)]>
以node1为例,所有操作在node2上重新操作一遍
(1)环境参数
[root@node1 be]# vi /etc/security/limits.conf
在文件最后添加如下内容
# End of file
* hard nofile 65536
* soft nofile 65536
然后重启该节点:reboot
(2)创建数据目录
[root@node1 fe]# cd /app/be
[root@node1 be]# mkdir storage
(3)编辑配置文件
[root@node1 be]# vi conf/be.conf
配置内容
priority_networks = 10.17.12.158/24
(4)启动BE节点
[root@node1 be]# sh bin/start_be.sh --daemon
[root@node1 be]#
(5)所有操作在node2上重新操作一遍
其中conf/be.conf文件配置priority_networks属性
priority_networks = 10.17.12.159/24
MySQL [(none)]> SHOW PROC '/backends'\G
*************************** 1. row ***************************
BackendId: 10093
Cluster: default_cluster
IP: 10.17.12.158
HostName: node1
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-12 11:09:44
LastHeartbeat: 2021-08-12 11:10:04
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 6
DataUsedCapacity: .000
AvailCapacity: 7.344 GB
TotalCapacity: 49.090 GB
UsedPct: 85.04 %
MaxDiskUsedPct: 85.04 %
ErrMsg:
Version: 0.12.0-rc03-Unknown
*************************** 2. row ***************************
BackendId: 10092
Cluster: default_cluster
IP: 10.17.12.159
HostName: node2
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-12 11:10:04
LastHeartbeat: 2021-08-12 11:10:04
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: .000
AvailCapacity: 17.879 GB
TotalCapacity: 49.090 GB
UsedPct: 63.58 %
MaxDiskUsedPct: 63.58 %
ErrMsg:
Version: 0.12.0-rc03-Unknown
*************************** 3. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 10.17.12.160
HostName: node3
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-12 10:38:34
LastHeartbeat: 2021-08-12 11:10:04
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 40
DataUsedCapacity: 5.991 KB
AvailCapacity: 7.812 GB
TotalCapacity: 49.090 GB
UsedPct: 84.09 %
MaxDiskUsedPct: 84.09 %
ErrMsg:
Version: 0.12.0-rc03-Unknown
3 rows in set (0.01 sec)
MySQL [(none)]>
使用how backends
命令也可以。
MySQL [(none)]> show backends \G
*************************** 1. row ***************************
BackendId: 11002
Cluster: default_cluster
IP: 10.17.12.158
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-13 09:46:23
LastHeartbeat: 2021-08-25 16:02:53
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 11
DataUsedCapacity: 2.389 KB
AvailCapacity: 2.281 GB
TotalCapacity: 49.090 GB
UsedPct: 95.35 %
MaxDiskUsedPct: 95.35 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:02:55"}
*************************** 2. row ***************************
BackendId: 11001
Cluster: default_cluster
IP: 10.17.12.159
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-13 09:41:46
LastHeartbeat: 2021-08-25 16:02:53
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 15
DataUsedCapacity: 1.542 KB
AvailCapacity: 12.093 GB
TotalCapacity: 49.090 GB
UsedPct: 75.37 %
MaxDiskUsedPct: 75.37 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:02:41"}
*************************** 3. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 10.17.12.160
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-25 15:57:11
LastHeartbeat: 2021-08-25 16:02:53
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 10
DataUsedCapacity: 3.084 KB
AvailCapacity: 1.903 GB
TotalCapacity: 49.090 GB
UsedPct: 96.12 %
MaxDiskUsedPct: 96.12 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:02:13"}
3 rows in set (0.00 sec)
MySQL [(none)]>