本文章主要是记录这几个组件的组合搭建, 以单机环境为例, 集群环境有待后续尝试.
mysql
下载地址: https://github.com/seata/seata/releases/tag/v1.3.0github
地址: https://github.com/seata/seata/tree/develop/script/config-centerweb
这一步跟1.0以前的版本不同, 下载的文件包中再也不包含config.txt等配置文件, 须要本身到github上进行下载. 需下载的文件有 config.txt 以及 nacos文件夹中的 nacos-config.shspring
这里还有须要注意的地方就是 config.txt文件必须是在nacos-config.sh 文件的上一级目录中, 并且说在的路径不能有空格sql
例如:数据库
修改config.txt中相关配置
app
win环境下运行nacos-config.sh须要借助git工具
spring-boot
当看到以下内容则表示已经添加完毕
工具
修改nacos配置列表中 store.db.url 的值
直到这个时候才能够运行 bin/seata-server.bat 启动 seata
安装步骤略
<dependencies> <!-- nacos --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency> <!-- seata --> <dependency> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> <version>1.3.0</version> <!-- 这里须要排除自身的seata-all --> <exclusions> <exclusion> <artifactId>seata-all</artifactId> <groupId>io.seata</groupId> </exclusion> </exclusions> </dependency> <!-- 导入与以前下载的seata版本一致的包 --> <dependency> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> <version>1.3.0</version> </dependency> <!-- feign --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies>
seata: enabled: true # 该属性须要与前面config.txt文件中的service.vgroupMapping后的值保持一致 tx-service-group: my_test_tx_group config: type: nacos nacos: namespace: serverAddr: 127.0.0.1:8848 group: SEATA_GROUP # 这个值未生效, 在nacos中依然为DEFAULT_GROUP, 待检查缘由 registry: type: nacos nacos: # seata 在nacos中的服务名 application: seata-server serverAddr: 127.0.0.1:8848 # 分组需和seate分组一致 group: SEATA_GROUP
项目正常启动, 终于不会报 no available server to connect. 这个错误提示了