运行部署

部署启动

  1. 执行以下命令,编译生成 ShardingSphere-Scaling 二进制包:
  1. git clone https://github.com/apache/shardingsphere.git;
  2. cd shardingsphere;
  3. mvn clean install -Prelease;

发布包所在目录为:/shardingsphere-distribution/shardingsphere-scaling-distribution/target/apache-shardingsphere-${latest.release.version}-shardingsphere-scaling-bin.tar.gz

  1. 解压缩发布包,修改配置文件 conf/server.yaml,这里主要修改启动端口,保证不与本机其他端口冲突,同时修改断点续传服务(可选)地址即可:
  1. port: 8888
  2. blockQueueSize: 10000
  3. workerThread: 30
  4. resumeBreakPoint:
  5. name: scalingJob
  6. registryCenter:
  7. type: ZooKeeper
  8. serverLists: localhost:2181
  9. props:
  10. retryIntervalMilliseconds: 10000
  1. 启动 ShardingSphere-Scaling:
  1. sh bin/start.sh
  1. 查看日志 logs/stdout.log,确保启动成功。

  2. 使用 curl 命令再次确认正常运行。

  1. curl -X GET http://localhost:8888/scaling/job/list

响应应为:

  1. {"success":true,"errorCode":0,"errorMsg":null,"model":[]}

结束 ShardingSphere-Scaling

  1. sh bin/stop.sh

应用配置项

应用现有配置项如下,相应的配置可在 conf/server.yaml 中修改:

名称说明默认值
portHTTP服务监听端口8888
blockQueueSize数据传输通道队列大小10000
workerThread工作线程池大小,允许同时运行的迁移任务线程数30
resumeBreakPoint断点续传服务