欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 维修 > liunx docker 部署 nacos seata sentinel

liunx docker 部署 nacos seata sentinel

2025/2/24 16:05:25 来源:https://blog.csdn.net/qq_31683775/article/details/144293765  浏览:    关键词:liunx docker 部署 nacos seata sentinel

部署nacos

1.按要求创建好数据库

2.创建docker 容器

docker run -d --name nacos-server -p 8848:8848 -p 9848:9848 -p 9849:9849 -e MODE=standalone -e SPRING_DATASOURCE_PLATFORM=mysql -e MYSQL_SERVICE_HOST=172.17.251.166 -e MYSQL_SERVICE_DB_NAME=ry-config -e MYSQL_SERVICE_PORT=3306 -e MYSQL_SERVICE_USER=root -e MYSQL_SERVICE_PASSWORD=TnF4mLZfW4B46fejDCt6QVC0XRP6of0H nacos/nacos-server:latest

部署seata

1.编辑配置文件registry.conf

registry {# file 、nacos 、eureka、redis、zk、consul、etcd3、sofatype = "nacos"nacos {application = "seata-server"serverAddr = "172.17.251.166:8848"group = "DEFAULT_GROUP"namespace = ""cluster = "DEFAULT"username = "nacos"password = "nacos"}file {name = "file.conf"}
}config {# file、nacos 、apollo、zk、consul、etcd3type = "nacos"nacos {serverAddr = "172.17.251.166:8848"namespace = ""group = "SEATA_GROUP"username = "nacos"password = "nacos"dataId = "seataServer.properties"}file {name = "file.conf"}
}

2.编写seata在nacos配置中心的seataServer.properties 配置文件

store.mode=db
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver
store.db.url=jdbc:mysql://172.17.251.166:3306/ry-seata?rewriteBatchedStatements=true
store.db.user=root
store.db.password=TnF4mLZfW4B46fejDCt6QVC0XRP6of0H
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000

3.启动容器

docker run --name seata-server142 -d\-p 8091:8091 \-p 7091:7091 \-e SEATA_IP=172.17.251.166 \-e SEATA_PORT=8091 \-e SEATA_CONFIG_NAME=file:/root/seata-config/registry \-v /opt/docker-data/seata/config:/root/seata-config  \seataio/seata-server:1.4.2

部署sentinel

docker run --name sentinel -d -p 8858:8858 -v /opt/docker-data/sentinel/app:/root/sentinel bladex/sentinel-dashboard

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词