本文章主要是記錄這幾個組件的組合搭建, 以單機環境爲例, 集羣環境有待後續嘗試.
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. 這個錯誤提示了