1. 下载启动配置nacos1.4.1
地址 https://github.com/alibaba/nacos/tags
选择 nacos-server-1.4.1.zip
解压
打开cmd或powershell切换到目录nacos-server-1.4.1\nacos\bin
执行 .\startup.cmd -m standalone
浏览器localhost:8848/nacos
创建namespace
2. 下载启动配置seata1.4.1
地址 https://github.com/seata/seata/releases
选择
解压seata-1.4.1 seata-server-1.4.1
创建seata库
执行seata-1.4.1\script\server\db\mysql.sql
切换cd seata-1.4.1\script\config-center
修改config.txt
参数
service.vgroupMapping.my_test_tx_group=default 事务组
store.mode=db
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver //mysql8
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true
store.db.user=
store.db.password=
切换cd seata-1.4.1\script\config-center\nacos
打开git bash
执行sh nacos-config.sh -h localhost -p 8848 -t seata -g SEATA_GROUP
查看nacos配置
cd seata-server-1.4.1\seata\conf
修改register.conf
type = "nacos" # 修改注册类型
nacos {
application = "seata-server"
serverAddr = "localhost:8848"
group = "SEATA_GROUP"
namespace = "seata"
cluster = "default"
username = ""
password = ""
}
type = “nacos” # 修改配置类型
nacos {
serverAddr = "localhost:8848"
namespace = "seata"
group = "SEATA_GROUP"
username = ""
password = ""
}
修改file.conf
打开cmd
cd seata-server-1.4.1\seata\bin
执行 .\seata-server.bat -p 9000 -m db(存储模式db或file)
查看nacos
在seata库执行seata-1.4.1\script\client\at\db\mysql.sql创建undo_log表
分库就按库创建多个undo_log表
这里没分库
3. 验证(流程有点多,没更了)
创建3个模块module
service-call(调用端) service-order(订单) service-storage(库存)
异常
超时
回滚