# seata-at **Repository Path**: heshj/seata-at ## Basic Information - **Project Name**: seata-at - **Description**: 分布式事务seata at模式 demo - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-04-06 - **Last Updated**: 2023-08-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 环境 * spring-boot 2.2.5.RELEASE * spring-cloud Hoxton.SR3 * spring-cloud-alibaba 2.2.1.RELEASE * seata-server 1.6.1 * 注册中心nacos * 配置中心nacos * 存储mysql * nacos-server 2.1.1 * mysql 5.7 # 部署 0. nacos-server-2.1.1\nacos\target\nacos-server.jar,文件大小太大,无法上传仓库。请自行下载后放入。 1. mysql创建4个数据库:seata、seata-at-account、seata-at-business、seata-at-order, 分别执行资料包/mysql下的脚本创建数据表。 2. 启动nacos-server:nacos-server-2.1.1\nacos\bin\startup.cmd 3. 登录nacos管理页面 * http://localhost:8848/nacos * nacos/nacos * 命名空间:heshj * 修改如下配置: * 打开配置管理-seataServer.properties文件 * 修改store.db.url、store.db.user、store.db.password 这3个配置。 4. 启动seata-server:seata-server-1.6.1\seata\bin\seata-server.bat * seata管理页面 * http://127.0.0.1:7091/#/login * seata/seata * nacos服务列表中,可以看到seata-server的注册信息。 5. 按需修改account-service模块、business-service模块、order-service模块中的application.yml配置信息, 如:修改datasource配置。seata配置不要修改,已对应nacos中的seataServer.properties中的配置。 6. 启动account-service模块、business-service模块、order-service模块,确保这3个服务和seata-server服务在同一个namespace中。 7. 部署完成。 8. 参考文章:https://blog.csdn.net/weixin_40777510/article/details/129685726?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522168076260916800225527770%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=168076260916800225527770&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-18-129685726-null-null.142^v81^insert_down38,201^v4^add_ask,239^v2^insert_chatgpt&utm_term=springcloud%E9%9B%86%E6%88%90seata%2Cnacos%E4%BD%9C%E4%B8%BA%E6%B3%A8%E5%86%8C%E4%B8%AD%E5%BF%83&spm=1018.2226.3001.4187 # 测试 * http://localhost:8000/test-commit 分布式事务提交 * http://localhost:8000/test-rollback 分布式事务回滚