『征文精选』ShardingSphere-Proxy:Base 事务基于 Seata 验证

本文分享了作者【ID:wsm12138】关于ShardingSphere-Proxy如何基于Seata进行分布式事务验证的实践,包括服务构建、配置获取、压测过程和结果展示。详细介绍了Seata柔性事务、ShardingSphere-Proxy的搭建配置以及Seata的相关配置文件。
摘要由CSDN通过智能技术生成

中文社区征文活动启动一周啦,我们陆陆续续收到了很多同学的优秀作品,今天为大家推荐其中的一篇,来自【ID:wsm12138】同学的实践心得。

同时欢迎更多的小伙伴参与,我们将持续为大家更新优秀文章。

About SEATA 柔性事务

【参考】 Seata 柔性事务 — ShardingSphere:Seata 柔性事务 :: ShardingSphere

服务构建

  • 服务规划
服务 IP 备注
Sysbench 127.0.0.1 Version:1.0.20
MySQL 127.0.0.1 Version:5.7.26
ShardingSphere-Proxy 127.0.0.1 GitHub - apache/shardingsphere:GitHub - apache/shardingsphere: Build criterion and ecosystem above multi-model databases
Seata 127.0.0.1 Version:1.4.2
  • ShardingSphere-Proxy 构建配置

PROXY 获取

【参考】

1、How to Set Up Your DEV Environment:

搭建项目及环境指南 :: ShardingSphere

2、Nightly Build: Index of /Proxy/

3、官网下载:下载 :: ShardingSphere

CONF 相关

SERVER.YAML

######################################################################################################

#

# If you want to configure governance, authorization and proxy properties, please refer to this file.

#

######################################################################################################

# mode:
#  type: Cluster
#  repository:
#    type: Zookeeper
#    props:
#      namespace: governance_ds
#      server-lists: localhost:2181
#      retryIntervalMilliseconds: 500
#      timeToLiveSeconds: 60
#      maxRetries: 3
#      operationTimeoutMilliseconds: 500
#  overwrite: true

rules:
 - !AUTHORITY
   users:
     - root@%:root
     - sharding@:sharding
   provider:
     type: NATIVE
#scaling:
#  blockQueueSize: 10000
#  workerThread: 40

 - !TRANSACTION
   defaultType: BASE
   providerType: Seata

props:
 max-connections-size-per-query: 1
 sql-show: true
#  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
#  xa-transaction-manager-type: Atomikos
#  proxy-opentracing-enabled: false
#  proxy-hint-enabled: false
#  sql-show: false
#  check-table-metadata-enabled: false
#  lock-wait-timeout-milliseconds: 50000 # The maximum time to wait for a lock
#    # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
#    # The default value is -1, which means set the minimum value for different JDBC drivers.
#  proxy-backend-query-fetch-size: -1

CONFIG-SHARDING.YAML

schemaName: sbtest_sharding

dataSources:

  ds_0:
    url: jdbc:mysql://127.0.0.1:3306/sbtest_sharding?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=1024
    use
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值