文章目录
环境准备
准备 ShardingSphere-Proxy 与 ShardingSphere-UI , 这次使用 5.0.0-alpha 版本.
ShardingSphere-Proxy 下载地址: https://archive.apache.org/dist/shardingsphere/5.0.0-alpha/
ShardingSphere-UI 下载地址:https://archive.apache.org/dist/shardingsphere/shardingsphere-ui-5.0.0-alpha/
ShardingSphere-Proxy 配置
将 ShardingSphere-Proxy 5.0.0-alpha 下载并解压后, 针对 conf 目录下的 server.yaml、config-xxx.yaml 文件做修改.
另外还需将 mysql 的驱动包放在 ext-lib 目录下 (没有就新建一个)
server.yaml 服务配置
server.yaml 中需要放开 Zookeeper 的链接配置、权限配置、以及属性配置
governance:
name: governance_ds
registryCenter:
type: ZooKeeper
serverLists: localhost:2181
props:
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
overwrite: false
authentication:
users:
root:
password: root
sharding:
password: sharding
authorizedSchemas: sharding_db
props:
max-connections-size-per-query: 1
acceptor-size: 16 # The default value is available processors count * 2.
executor-size: 16 # Infinite by default.
proxy-frontend-flush-threshold: 128 # The defa