git clone --depth 1 https://github.com/apache/shardingsphere.git
cd shardingsphere
mvn clean install -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests -Prelease
发布包:
或者通过下载页面获取安装包。
conf/server.yaml
,这里主要修改启动端口,保证不与本机其他端口冲突,同时修改断点续传服务(可选)地址即可:scaling:
port: 8888
blockQueueSize: 10000
workerThread: 30
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: governance_ds
server-lists: localhost:2181
sh bin/server_start.sh
查看 scaling 日志 logs/stdout.log
,确保启动成功。
使用 curl 命令再次确认 scaling 正常运行。
curl -X GET http://localhost:8888/scaling/job/list
响应应为:
{"success":true,"errorCode":0,"errorMsg":null,"model":[]}
conf/server.yaml
,这里主要是开启 scaling
和 mode
配置:scaling:
blockQueueSize: 10000
workerThread: 40
clusterAutoSwitchAlgorithm:
type: IDLE
props:
incremental-task-idle-minute-threshold: 30
dataConsistencyCheckAlgorithm:
type: DEFAULT
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: governance_ds
server-lists: localhost:2181
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
overwrite: false
sh bin/start.sh
logs/stdout.log
,确保启动成功。 sh bin/server_stop.sh
sh bin/stop.sh
应用现有配置项如下,相应的配置可在 conf/server.yaml
中修改:
名称 | 说明 | 默认值 |
---|---|---|
port | HTTP服务监听端口 | 8888 |
blockQueueSize | 数据传输通道队列大小 | 10000 |
workerThread | 工作线程池大小,允许同时运行的迁移任务线程数 | 30 |