Docker 配置 Seata 集成 Nacos
1、拉取镜像
docker pull seataio/seata-server:1.4.2 docker run --name seata -p 8091:8091 -d seataio/seata-server:1.4.2
2、创建文件
mkdir -p /opt/docker_seata
3、复制配置文件并停止seata服务
docker cp seata:/seata-server /opt/docker_seata docker stop seata docker rm seata
4、修改文件
cd /opt/docker_seata/seata-server/resources
4.1、修改registry.conf
4.2、修改file.conf。主要修改mysql的地址,用户名,密码。这里mysql是5.+版本的,使用8+版本的注意修改驱动
url = "jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai"
5、运行
docker run --name seata \ -p 8091:8091 \ -e SEATA_CONFIG_NAME=file:/root/seata-config/registry \ -e SEATA_IP=192.168.206.163 \ -v /opt/docker_seata/seata-server/resources:/root/seata-config \ -d 4909c4c024dc