版本说明:
seata-server:1.4.0
SpringCloud:Finchley.RC2
spring-cloud-starter-alibaba-seata:2.2.0.RELEASE
seata-spring-boot-starter:1.4.0
代码实战:
seata-server安装部署:
下载地址:https://github.com/seata/seata/releases
seata文档地址:https://seata.io/zh-cn/docs/overview/what-is-seata.html
1:下载版本 1.4.0 截图错误,大家知道下载哪个版本就行
2:下载之后解压
3:配置registry.conf 如下:
registry {
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
#使用什么注册,就选择什么,这里写 eureka
type = "eureka"
loadBalance = "RandomLoadBalance"
loadBalanceVirtualNodes = 10
nacos {
application = "seata-server"
serverAddr = "127.0.0.1:8848"
group = "SEATA_GROUP"
namespace = ""
cluster = "default"
username = ""
password = ""
}
eureka {
#eureka的 server地址
serviceUrl = "http://localhost:8081/eureka"
#这个application对应的值就是将来 seata注册到eureka上的服务名字 application-name
application = "seata-server"
weight = "1"
}
redis {
serverAddr = "localhost:6379"
db = 0
password = ""
cluster = "default"
timeout = 0
}
zk {
cluster = "default"
serverAddr = "127.0.0.1:2181"
sessionTimeout = 6000
connectTimeout = 2000
username = ""
password = ""
}
consul {
cluster = "default"
serverAddr = "127.0.0.1:8500"
}
etcd3 {
cluster = "default"
serverAddr = "http://localhost:2379"
}
sofa {
serverAddr = "127.0.0.1:9603"
application = "default"
region = "DEFAULT_ZONE"
datacenter = "DefaultDataCenter"
cluster = "default"
group = "SEATA_GROUP"
addressWaitTime = "3000"
}
file {
name = "file.conf"
}
}
config {
# file、nacos 、apollo、zk、consul、etcd3
type = "nacos"
nacos {
serverAddr = "127.0.0.1:8848"
namespace = ""
group = "SEATA_GROUP"
username = ""
password = ""
}
consul {
serverAddr = "127.0.0.1:8500"
}
apollo {
appId = "seata-server"
apolloMeta = "http://192.168.1.204:8801"
namespace = "application"
apolloAccesskeySecret = ""
}
zk {
serverAddr = "127.0.0.1:2181"
sessionTimeout = 6000
connectTimeout = 2000
username = ""
password = ""
}
etcd3 {
serverAddr = "http://localhost:2379"
}
file {
name = "file.conf"
}