吐槽一下,官方文档是真少,而且更新很不及时。。
官网地址:直接部署 | Apache Seata
上述地址也包含了下载链接,我用的1.8版本,挑一些关键配置说一下
1、服务器上,seata/conf/application.yml,将seata.config和seata.registry都改为nacos相关信息
2、将nacos,seata-server中,新增store相关的配置,必须顶格,无需前缀。相关参数,全部为驼峰格式
3、库里需手动建表
seata/script/server/db目录下有对应库的sql语句,按需执行即可
4、代码附录
seata: config: # support: nacos, consul, apollo, zk, etcd3 type: nacos nacos: server-addr: 192.168.20.100:8848 namespace: seata group: SEATA_GROUP username: nacos password: nacos context-path: data-id: seata-server.yml ##if use MSE Nacos with auth, mutex with username/password attribute #access-key: #secret-key: # data-id: seataServer.properties # registry: # support: nacos, eureka, redis, zk, consul, etcd3, sofa type: nacos nacos: application: seata-server server-addr: 192.168.20.100:8848 group: SEATA_GROUP namespace: seata cluster: default username: nacos password: nacos context-path: ##if use MSE Nacos with auth, mutex with username/password attribute #access-key: #secret-key: #
store: # support: file 、 db 、 redis mode: db session: mode: db lock: mode: db db: datasource: druid dbType: mysql driverClassName: com.mysql.cj.jdbc.Driver url: jdbc:mysql://192.168.20.100:3306/seata?useSSL=false&useUnicode=true&rewriteBatchedStatements=true user: root password: password minConn: 10 maxConn: 100 globalTable: global_table branchTable: branch_table lockTable: lock_table distributedLockTable: distributed_lock queryLimit: 1000 maxWait: 5000 # server: # service-port: 8091 #If not configured, the default is '${server.port} + 1000'