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
相关推荐
全镇人的希望20 分钟前
[特殊字符] 企业级Docker私有仓库实战:3步搭建Harbor安全仓库,镜像管理从此高效无忧
docker·运维开发·私有化
穷儒公羊2 小时前
第一部分——Docker篇 第三章 构建自定义镜像
java·运维·后端·学习·docker·云原生·容器
weixin_428498492 小时前
Docker 容器内运行程序的性能开销
docker·容器
forestsea3 小时前
Docker 是什么? Docker 基本观念介绍与容器和虚拟机的比较
docker·云原生
Gold Steps.3 小时前
基于Kubeadm实现K8S集群扩缩容指南
运维·容器·k8s
冯浩(grow up)14 小时前
macOS可视化桌面配置docker加速器
macos·docker·容器
Micheal_Dad15 小时前
在macOS的docker中如何安装及运行ROS2
macos·docker
桥边驿语人16 小时前
使用Docker Desktop进行本地打包和推送
运维·docker·容器·本地打包
sondx18 小时前
mac安装浏览器闪退处理
运维·docker·容器
郭涤生19 小时前
第二章:Docker及Kubernetes基础 重难点详解_《再也不踩坑的kubernetes实战指南》
笔记·docker·容器·kubernetes