复古 护眼 海天 深邃 暗黑 默认
Logo
扩容集群

扩容集群 #

使用命令 spex cluster scale --name <cluster-name> --host <host-ip> 扩容集群。

示例: 在 demo 集群扩容 IP 为 10.0.1.2 的 ShardingSphere-Proxy 节点。

$ spex cluster scale --name demo --host 10.0.1.2

2.执行命令 spex cluster install -n demo --type proxy --host 10.0.1.2 安装新增节点 。

[root@community /]# spex cluster install -n demo --type proxy --host 10.0.1.2
ShardingSphere-Proxy
check proxy install dir exist!      
Completed....... 
ShardingSphere-Proxy
create install directory      
10.0.1.2:3388 =>success
install proxy      
10.0.1.2:3388 =>success
copying shell file      
10.0.1.2:3388 =>success
copying config file      
10.0.1.2:3388 =>success
copying agent config file      
skipped host: 10.0.1.2 item:None
copying depend file      
10.0.1.2:3388 =>success
Completed.......

3.执行命令 spex cluster start --name demo --type proxy --host 10.0.1.2 启动新增节点。

[root@community /]# spex cluster start --name demo --type proxy --host 10.0.1.2
ShardingSphere-Proxy
start proxy      
10.0.1.2:3388 =>success
Starting the ShardingSphere-Proxy ...
The port is 3388
The classpath is /root/demo/apache-shardingsphere-5.0.0-shardingsphere-proxy-bin/conf:.:/root/demo/apache-shardingsphere-5.0.0-shardingsphere-proxy-bin/lib/*:/root/demo/apache-shardingsphere-5.0.0-shardingsphere-proxy-bin/ext-lib/*
Please check the STDOUT file: /root/demo/apache-shardingsphere-5.0.0-shardingsphere-proxy-bin/logs/stdout.log
Completed.......