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
相关推荐
LeonNo112 小时前
k8s,operator
云原生·容器·kubernetes
云川之下2 小时前
【k8s源码】kubernetes-1.22.3\staging 目录作用
云原生·容器·kubernetes
怡雪~2 小时前
k8s的Pod亲和性
linux·容器·kubernetes
A5rZ2 小时前
CTF: 在本地虚拟机内部署CTF题目docker
运维·网络安全·docker·容器
fragrans3 小时前
设置docker镜像加速器
运维·docker·容器
Karoku0664 小时前
【自动化部署】Ansible 基础命令行模块
运维·服务器·数据库·docker·容器·自动化·ansible
~菜鸟笔记~5 小时前
Docker学习笔记
学习·docker
诡异森林。7 小时前
Docker--Docker Container(容器)
docker·容器·eureka
代码浪人7 小时前
docker 基于Debian镜像安装FreeSwitch1.10.7
docker·容器·debian·freeswitch
LeonNo1113 小时前
k8s, deployment
java·容器·kubernetes