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、sofa
  type = "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、etcd3
  type = "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
相关推荐
sj11637394034 分钟前
docker-compose方式启动Kafka Sasl加密认证(无zk)
docker·kafka
Dontla1 小时前
Docker run --add-host参数解析(在容器启动时向/etc/hosts文件中添加自定义的主机名与IP映射)(适用于临时调试或测试)
tcp/ip·docker·容器
西西小飞龙1 小时前
Docker和K8S中pod、services、container的介绍和关系
docker·容器·kubernetes
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
kngines1 小时前
【实战 ES】实战 Elasticsearch:快速上手与深度实践-1.3.1单节点安装(Docker与手动部署)
大数据·elasticsearch·docker
飞火流星0202713 小时前
docker安装etcd:docker离线安装etcd、docker在线安装etcd、etcd镜像下载、etcd配置详解、etcd常用命令、安装常见问题总结
docker·容器·etcd
magrich14 小时前
Docker usage on ubuntu
ubuntu·docker·容器
ZZDICT18 小时前
两台互通的服务器使用Docker部署一主两从MySQL8.0.35
运维·服务器·mysql·docker