seata注册到nacos(docker)

1、安装:docker run --name seata-server2 -p 8091:8091 -p 7091:7091 seataio/seata-server:1.5.1
复制seata-server2到服务器,然后过河拆桥
2、创建挂载目录
mkdir -p /ssy/seata_docker
3、将容器 resources文件挂载到宿主机
docker cp seata-server2:/seata-server/resources /ssy/seata_docker
4、设置权限
chmod -R 777 /ssy/seata_docker/resources
5、运行docker挂载:
docker stop seata-server2
docker run --name seata-server -p 8091:8091 -p 7091:7091 -v /ssy/seata_docker/resources:/seata-server/resources seataio/seata-server:1.5.1
6、配置yml
vi /ssy/seata_docker/resources/application.yml
7、重启seata-server
docker restart seata-server2

server:
  port: 7091

spring:
  application:
    name: seata-server

logging:
  config: classpath:logback-spring.xml
  file:
    path: ${user.home}/logs/seata
  extend:
    logstash-appender:
      destination: 127.0.0.1:4560
    kafka-appender:
      bootstrap-servers: 127.0.0.1:9092
      topic: logback_to_logstash

console:
  user:
    username: seata
    password: seata

seata:
  config:
    # support: nacos, consul, apollo, zk, etcd3
    type: nacos
    nacos:
      server-addr: xxxip:8848
      namespace: 9ea819ed-a949-43f1-bc49-b03b7baf9275
      group: SEATA_GROUP
      username: nacos
      password: nacos
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key: ""
      #secret-key: ""
      data-id: seataServer.properties
  registry:
    # support: nacos, eureka, redis, zk, consul, etcd3, sofa
    type: nacos
    nacos:
      application: seata-server
      server-addr: xxxip:8848
      group: SEATA_GROUP
      namespace: 9ea819ed-a949-43f1-bc49-b03b7baf9275
      cluster: default
      username: nacos
      password: nacos
  store:
    # support: file 、 db 、 redis
    mode: db
    db:
      datasource: druid
      db-type: mysql
      driver-class-name: com.mysql.jdbc.Driver
      url: jdbc:mysql://xxxip:3306/seata?rewriteBatchedStatements=true
      user: root
      password: qwerasdf123
      min-conn: 5
      max-conn: 100
      global-table: global_table
      branch-table: branch_table
      lock-table: lock_table
      distributed-lock-table: distributed_lock
      query-limit: 100
      max-wait: 5000
#  server:
#    service-port: 8091 #If not configured, the default is '${server.port} + 1000'
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login

你可能感兴趣的:(docker,容器,运维)