集群拓扑配置文件说明 #
通过 SphereEx-Boot 部署集群时,需要提供一份 yaml 格式的集群拓扑配置文件,配置数据如下。
- cluster_name: 集群名字
- install_user: 登录部署机用户名
- install_password: 登录部署机用户密码
- proxy: ShardingSphere-Proxy 配置
- version: ShardingSphere-Proxy 版本标识
- file: 主控机 ShardingSphere-Proxy 安装包文件路径
- conf_dir:主控机 ShardingSphere-Proxy 业务配置文件目录
- depend_files:主控机 ShardingSphere-Proxy 驱动 jar 包文件路径
- install_dir:部署机 ShardingSphere-Proxy 部署目录
- port:部署机 ShardingSphere-Proxy 启动端口
- overwrite:如果部署机安装目录已经存在,是否重新安装。默认 true。
- servers: 部署机信息列表
- host:部署机 IP 地址
- port:部署机 ShardingSphere-Proxy 启动端口。(非必要,不配置时以 proxy 中配置为准)
- install_dir:部署机 ShardingSphere-Proxy 安装目录(非必要,不配置时以 proxy 中配置为准)
- agent_conf_file:主控机 ShardingSphere-Proxy 中 agent 配置文件路径(非必要,不配置时以 proxy 中配置为准)
- overwrite:如果部署机安装目录已经存在,是否重新安装,默认 true。(非必要,不配置时以 proxy 中配置为准)
- zookeeper:ZooKeeper 配置 (如果不需要 ZooKeeper 时可以不配置)
- version:ZooKeeper 版本标识
- file:主控机 ZooKeeper 安装文件路径
- conf_file:主控机 ZooKeeper zoo.cfg 配置文件路径
- install_dir:部署机 Zookeeper 安装目录
- data_dir:部署机 ZooKeeper 配置文件 zoo.cfg 中 dataDir 配置值
- port:部署机 ZooKeeper 启动端口
- overwrite:如果部署机安装目录已经存在,是否重新安装,默认 true。
- servers:ZooKeeper 部署机列表
- host:部署机 IP 地址
- myid:ZooKeeper 集群 myid 值
- port:部署机 ZooKeeper 启动端口(非必要,不配置时以 ZooKeeper 中配置为准)
- install_dir:部署机 ZooKeeper 安装目录(非必要,不配置时以 ZooKeeper 中配置为准)
- conf_file:主控机 Zookeeper zoo.cfg 配置文件路径(非必要,不配置时以 ZooKeeper 中配置为准)
- data_dir:部署机 ZooKeeper 配置文件 zoo.cfg 中 dataDir 配置值(非必要,不配置时以 ZooKeeper 中配置为准)
- overwrite:如果部署机安装目录已经存在,是否重新安装,默认 true。(非必要,不配置时以 ZooKeeper 中配置为准)
集群拓扑配置示例:
cluster_name: demo
install_user: root
install_password: 'root'
proxy:
version: '5.0.0'
install_dir: /opt/shardingsphere-proxy
conf_dir: /root/demo/conf
file: /root/demo/apache-shardingsphere-5.0.0-shardingsphere-proxy-bin.tar.gz
depend_files:
- /root/demo/mysql-connector-java-5.1.47.jar
port: 3307
overwrite: true
servers:
- host: 10.0.1.1
zookeeper:
version: '3.6.3'
install_dir: /opt/zookeeper
data_dir: /tmp/zookeeper
conf_file: /root/demo/zoo.cfg
file: /root/demo/apache-zookeeper-3.6.3-bin.tar.gz
port: 2181
overwrite: true
servers:
- host: 10.0.1.1
myid: 1