一 获取镜像
docker search seata
docker pull seataio/seata-server
二 创建本地Seata数据库
? ? ? ? seata的官方数据库脚本seata/mysql.sql at develop · seata/seata · GitHub:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution. - seata/mysql.sql at develop · seata/seatahttps://github.com/seata/seata/blob/develop/script/server/db/mysql.sql
三 Seata的配置文件配置到配置中心nacos中
????????获取seata源码
git clone https://github.com/seata/seata.git
????????进入script目录修改配置,这里只是展示部分配置
????????
?????????使得配置进入写入Nacos中
sh nacos-config.sh -h nacos访问的ip -p 8848 -g SEATA_GROUP -t 自定义的命名空间id
????????
? ? ? ? nacos配置中心的seata配置
????????
四 配置seata注册nacos的文件
mkdir /data/seata/config
? ? ? ? registry.conf
registry {
type = "nacos"
nacos {
application = "seata-server"
group = "SEATA_GROUP"
cluster = "default"
serverAddr = "ip:8848"
namespace = "b94cfd49-3743-4bac-b1d3-41dcc2d07070"
username = "nacos"
password = "nacos"
}
}
config {
type = "nacos"
nacos {
serverAddr = "ip:8848"
namespace = "b94cfd49-3743-4bac-b1d3-41dcc2d07070"
group = "SEATA_GROUP"
username = "nacos"
password = "nacos"
}
}
? ? ? ? file.conf
store {
## store mode: file、db、redis
mode = "db"
## rsa decryption public key
publicKey = "1"
## file store property
db {
## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
datasource = "druid"
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://ip:3306/seata"
user = "root"
password = "root"
minConn = 5
maxConn = 100
globalTable = "global_table"
branchTable = "branch_table"
lockTable = "lock_table"
queryLimit = 100
maxWait = 5000
}
}
五 启动seata
????????启动命令
docker run --name seata \ -p 8091:8091 \ -e SEATA_CONFIG_NAME=file:/root/seata-config/registry \ -e SEATA_IP=IP \ -v /data/seata/config:/root/seata-config \ -d --restart always seataio/seata-server
|