cd devops/local/nacos
docker-compose up -d mysql
docker-compose up -d nacos
https://github.com/alibaba/nacos/blob/1.4.2/distribution/conf/nacos-mysql.sql
http://127.0.0.1:8848/nacos/index.html
sh nacos-config.sh -h localhost -g SEATA_GROUP
SEATA_IP=192.168.0.108
docker-compose up -d seata
- server.port=28080
- 将application.yaml registry /config type改为nacos
- 将StorageClient url 改为 http://localhost:18080
- server.port=18080
- 将application.yaml registry /config type改为nacos
curl --location --request POST 'http://localhost:28080/business/buy' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId": 1,
"productId": 1,
"count": 1
}'
curl --location --request POST 'http://localhost:28080/business/buy-rollback' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId": 1,
"productId": 1,
"count": 1
}'