linux 驱动设计4.0 宋宝华_Sharing-Proxy部署&启动(4.0.0-RC3)

本文详细介绍了如何在Linux系统上部署和启动Sharding-Proxy 4.0.0-RC3。步骤包括从Apache官网下载压缩包,使用tar命令解压,解析目录结构,修改配置文件如server.yaml和config-proxy.yaml,添加数据库驱动到lib目录,最后执行start.sh启动并检查日志确认启动状态。
摘要由CSDN通过智能技术生成

1.进入https://www.apache.org/dyn/closer.cgi?path=incubator/shardingsphere/4.0.0-RC3/apache-shardingsphere-incubating-4.0.0-RC3-sharding-proxy-bin.tar.gz下载压缩包

2.解压缩

Linux下可直接使用tar -zxvf解压。

windows环境,请使用tar zxvf解压,不要使用压缩工具,否则可能出现bin文件夹中的.jar由于名称太长而被截断,如下图所示。

dce31e5d11d34d5e0fa4589418b4f17c.png

导致启动start.bat/start.sh失败。如下图所示

dc2fc752c4a0b4dedc73e39c5c2afbc7.png

3.目录结构

75a0b776c9a232a5cf4979b94563ae19.png
  • bin里面包含start/stop脚本
  • conf包含配置文件,其中server
  • lib包含系统及其依赖的jar包(缺少数据库驱动jar)
  • 运行bin里面的start.sh/start.bat后会生成logs,里面包含运行日志

4.修改conf下的配置文件(其中server.yaml必须修改)

  • server.yaml中包含orchestration(注册中心配置),authentication(连接proxy时使用的用户名&密码及其访问权限),props(proxy基本配置)
orchestration:
  name: orchestration_ds
  overwrite: true
  registry:
    type: zookeeper
    serverLists: localhost:2181
    namespace: orchestration

authentication:
  users:
    root:
      password: root
    sharding:
      password: 123
      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 default value is 128.
    # LOCAL: Proxy will run with LOCAL transaction.
    # XA: Proxy will run with XA transaction.
    # BASE: Proxy will run with B.A.S.E transaction.
  proxy.transaction.type: LOCAL
  proxy.opentracing.enabled: false
  proxy.hint.enabled: false
  query.with.cipher.column: true
  sql.show: false
  • config-proxy.yaml包含schemaName(proxy对外提供的库名),dataSources(数据源配置),shardingRule(路由配置),这里我已单库单表为例,使用分库分表可自行更改配置文件
schemaName: default_db

dataSources:
  FenqileDB:
      url: jdbc:mysql://127.0.0.1:3306/synchronization_db?serverTimezone=UTC&useSSL=false
      username: root
      password: 123
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
shardingRule:
  tables:
    t_default:
      actualDataNodes: default_db.t_synchronization

5.向lib中加入数据库驱动

我使用的是mysql数据库,故加入mysql驱动jar,如下图所示

4a2489abff9d44c594bc735c7497b59e.png

6.运行

运行start.sh脚本,进入logs查看日志

cdef7a9f1d9bfff0d50467929f646f9f.png

ACTIVE表示启动成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值