运行部署

优质
小牛编辑
130浏览
2023-12-01

部署启动

  1. 执行以下命令,编译生成 ShardingSphere-Scaling 二进制包:

git clone https://github.com/apache/shardingsphere.git;
cd shardingsphere;
mvn clean install -Prelease;

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

  1. 解压缩发布包,修改配置文件 conf/server.yaml,这里主要修改启动端口,保证不与本机其他端口冲突,同时修改断点续传服务(可选)地址即可:
port: 8888
blockQueueSize: 10000
workerThread: 30

resumeBreakPoint:
  name: scalingJob
  registryCenter:
    type: ZooKeeper
    serverLists: localhost:2181
    props:
      retryIntervalMilliseconds: 10000
  1. 启动 ShardingSphere-Scaling:
sh bin/start.sh
  1. 查看日志 logs/stdout.log,确保启动成功。

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

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

响应应为:

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

结束 ShardingSphere-Scaling

sh bin/stop.sh

应用配置项

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

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