两分钟快速安装 ShardingSphere-Proxy(5.2.1)

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

借本地虚机环境安装 ShardingSphere-Proxy 5.2.1 机会,记录了安装过程,供大家参考。

ShardingSphere 支持多种安装方式,如通过二进制包、使用 Docker使用 Helm。本文档介绍如何通过二进制包快速构建 ShardingSphere-Proxy 测试环境,使用版本为 5.2.1。更详细的安装说明,请参考用户手册:使用二进制发布包安装 ShardingSphere-Proxy。

环境要求

  • 操作系统:Linux,Windows
  • Java JRE:8 或以上版本

安装 ShardingSphere-Proxy

通过 5 个步骤完成快速安装:

  1. 下载产品包
  2. 解压产品包
  3. 修改配置文件(server.yaml)
  4. 引入数据库驱动
  5. 启动服务

环境信息如下:

  • 配置: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

引入

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值