借本地虚机环境安装 ShardingSphere-Proxy 5.2.1 机会,记录了安装过程,供大家参考。
ShardingSphere 支持多种安装方式,如通过二进制包、使用 Docker 或使用 Helm。本文档介绍如何通过二进制包快速构建 ShardingSphere-Proxy 测试环境,使用版本为 5.2.1。更详细的安装说明,请参考用户手册:使用二进制发布包安装 ShardingSphere-Proxy。
文章目录
环境要求
- 操作系统:Linux,Windows
- Java JRE:8 或以上版本
安装 ShardingSphere-Proxy
通过 5 个步骤完成快速安装:
- 下载产品包
- 解压产品包
- 修改配置文件(server.yaml)
- 引入数据库驱动
- 启动服务
环境信息如下:
- 配置:1c/2g
- 操作系统:CentOS 7.6
- Java:1.8.0
下载产品包
可通过 wget 方式直接下载到测试机,或点此下载 apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz 软件包后,手动上传至测试机。
# cd /opt
# wget https://archive.apache.org/dist/shardingsphere/5.2.1/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz
解压产品包
# pwd
/opt
# tar xf apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz
# cd apache-shardingsphere-5.2.1-shardingsphere-proxy-bin
# ls
LICENSE NOTICE README.txt bin conf lib licenses
修改配置文件(server.yaml)
先对初始配置文件拷贝备份。
# pwd
/opt/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin
# cp ./conf/server.yaml ./conf/server.yaml.bak
默认的配置文件将不能被直接使用,需要对运行模式和权限配置进行修改。
# pwd
/opt/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin
# vi ./conf/server.yaml
--可将如下内容追加至 server.yaml 末尾
mode:
type: Standalone
repository:
type: JDBC
rules:
- !AUTHORITY
users:
- root@%:root
- sharding@:sharding
provider:
type: ALL_PERMITTED

本文详细介绍了如何在本地虚拟机上通过二进制包安装ShardingSphere-Proxy 5.2.1,包括下载、配置、驱动引入及服务启动,适用于Linux和Windows系统,Java JRE 8+。
最低0.47元/天 解锁文章
4860

被折叠的 条评论
为什么被折叠?



