1. <i id="s6b2k"><small id="s6b2k"></small></i>
    <b id="s6b2k"><bdo id="s6b2k"></bdo></b>
  2. <wbr id="s6b2k"></wbr>

    SEATA事務服務DOCKER部署的過程詳解_docker

    來源:腳本之家  責任編輯:小易  

    1、創庫授權語句

    > create database seata;
    > grant all on seata.* to seata_user@'%' identified by '123455'

    2、數據庫建表語句

    cat create_seata_table.sql
    
    -- -------------------------------- The script used when storeMode is 'db' --------------------------------
    -- the table to store GlobalSession data
    CREATE TABLE IF NOT EXISTS `global_table`
    (
      `xid`            VARCHAR(128) NOT NULL,
      `transaction_id`      BIGINT,
      `status`          TINYINT   NOT NULL,
      `application_id`      VARCHAR(32),
      `transaction_service_group` VARCHAR(32),
      `transaction_name`     VARCHAR(128),
      `timeout`          INT,
      `begin_time`        BIGINT,
      `application_data`     VARCHAR(2000),
      `gmt_create`        DATETIME,
      `gmt_modified`       DATETIME,
      PRIMARY KEY (`xid`),
      KEY `idx_gmt_modified_status` (`gmt_modified`, `status`),
      KEY `idx_transaction_id` (`transaction_id`)
    ) ENGINE = InnoDB
     DEFAULT CHARSET = utf8;
    
    -- the table to store BranchSession data
    CREATE TABLE IF NOT EXISTS `branch_table`
    (
      `branch_id`     BIGINT    NOT NULL,
      `xid`        VARCHAR(128) NOT NULL,
      `transaction_id`  BIGINT,
      `resource_group_id` VARCHAR(32),
      `resource_id`    VARCHAR(256),
      `branch_type`    VARCHAR(8),
      `status`      TINYINT,
      `client_id`     VARCHAR(64),
      `application_data` VARCHAR(2000),
      `gmt_create`    DATETIME(6),
      `gmt_modified`   DATETIME(6),
      PRIMARY KEY (`branch_id`),
      KEY `idx_xid` (`xid`)
    ) ENGINE = InnoDB
     DEFAULT CHARSET = utf8;
    
    -- the table to store lock data
    CREATE TABLE IF NOT EXISTS `lock_table`
    (
      `row_key`    VARCHAR(128) NOT NULL,
      `xid`      VARCHAR(96),
      `transaction_id` BIGINT,
      `branch_id`   BIGINT    NOT NULL,
      `resource_id`  VARCHAR(256),
      `table_name`   VARCHAR(32),
      `pk`       VARCHAR(36),
      `gmt_create`   DATETIME,
      `gmt_modified`  DATETIME,
      PRIMARY KEY (`row_key`),
      KEY `idx_branch_id` (`branch_id`)
    ) ENGINE = InnoDB
     DEFAULT CHARSET = utf8;

     3、導入建表語句

    mysql -useata_user -p seata < create_seata_table.sql

     4、FILE.CONF修改數據庫連接信息

    cat /home/seata-server/resources/file.conf
    ## transaction log store, only used in seata-server
    store {
     ## store mode: file、db、redis
     mode = "db"
     ## rsa decryption public key
     publicKey = ""
     ## file store property
     file {
      ## store location dir
      dir = "sessionStore"
      # branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
      maxBranchSessionSize = 16384
      # globe session size , if exceeded throws exceptions
      maxGlobalSessionSize = 512
      # file buffer size , if exceeded allocate new buffer
      fileWriteBufferCacheSize = 16384
      # when recover batch read size
      sessionReloadReadSize = 100
      # async, sync
      flushDiskMode = async
     }
    
     ## database store property
     db {
      ## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
      datasource = "druid"
      ## mysql/oracle/postgresql/h2/oceanbase etc.
      dbType = "mysql"
      driverClassName = "com.mysql.jdbc.Driver"
      ## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
      url = "jdbc:mysql://192.168.56.30:3306/seata?rewriteBatchedStatements=true" user = "seata_user"
      password = "123455"
      minConn = 5
      maxConn = 100
      globalTable = "global_table"
      branchTable = "branch_table"
      lockTable = "lock_table"
      queryLimit = 100
      maxWait = 5000
     }
    
     ## redis store property
     redis {
      ## redis mode: single、sentinel
      mode = "single"
      ## single mode property
      single {
       host = "127.0.0.1"
       port = "6379"
      }
      ## sentinel mode property
      sentinel {
       masterName = ""
       ## such as "10.28.235.65:26379,10.28.235.65:26380,10.28.235.65:26381"
       sentinelHosts = ""
      }
      password = ""
      database = "0"
      minConn = 1
      maxConn = 10
      maxTotal = 100
      queryLimit = 100
     }
    }

    5、REGISTRY.CONF修改注冊NACOS連接信息

    cat /home/seata-server/resources/registry.conf
    registry {
     # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
     type = "nacos"
     loadBalance = "RandomLoadBalance"
     loadBalanceVirtualNodes = 10
    
     nacos {
      application = "es-provider-seata"
      serverAddr = "192.168.56.30:8848"
      group = "DEFAULT_GROUP"
      namespace = ""
      cluster = "default"
      username = "nacos"
      password = "nacos"
     }
     eureka {
      serviceUrl = "http://localhost:8761/eureka"
      application = "default"
      weight = "1"
     }
     redis {
      serverAddr = "localhost:6379"
      db = 0
      password = ""
      cluster = "default"
      timeout = 0
     }
     zk {
      cluster = "default"
      serverAddr = "127.0.0.1:2181"
      sessionTimeout = 6000
      connectTimeout = 2000
      username = ""
      password = ""
     }
     consul {
      cluster = "default"
      serverAddr = "127.0.0.1:8500"
      aclToken = ""
     }
     etcd3 {
      cluster = "default"
      serverAddr = "http://localhost:2379"
     }
     sofa {
      serverAddr = "127.0.0.1:9603"
      application = "default"
      region = "DEFAULT_ZONE"
      datacenter = "DefaultDataCenter"
      cluster = "default"
      group = "SEATA_GROUP"
      addressWaitTime = "3000"
     }
     file {
      name = "file.conf"
     }
    }
    
    config {
     # file、nacos 、apollo、zk、consul、etcd3
     type = "file"
    
     nacos {
      serverAddr = "127.0.0.1:8848"
      namespace = ""
      group = "SEATA_GROUP"
      username = ""
      password = ""
      dataId = "seataServer.properties"
     }
     consul {
      serverAddr = "127.0.0.1:8500"
      aclToken = ""
     }
     apollo {
      appId = "seata-server"
      ## apolloConfigService will cover apolloMeta
      apolloMeta = "http://192.168.1.204:8801"
      apolloConfigService = "http://192.168.1.204:8080"
      namespace = "application"
      apolloAccesskeySecret = ""
      cluster = "seata"
     }
     zk {
      serverAddr = "127.0.0.1:2181"
      sessionTimeout = 6000
      connectTimeout = 2000
      username = ""
      password = ""
     }
     etcd3 {
      serverAddr = "http://localhost:2379"
     }
     file {
      name = "file.conf"
     }
    }

    6、DOCKER部署服務

    docker run  --name seata-server-latest -p 8091:8091 \
    -v /home/seata-server/resources/file.conf:/seata-server/resources/file.conf \ 
    -v /home/seata-server/resources/registry.conf:/seata-server/resources/registry.conf \
    -v /home/seata-server/logs:/root/logs \
    seataio/seata-server:1.3.0

    到此這篇關于SEATA事務服務DOCKER部署的過程詳解的文章就介紹到這了,更多相關seata docker部署內容請搜索真格學網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持真格學網!

    您可能感興趣的文章:十分鐘學會用docker部署微服務Linux服務器下利用Docker部署.net Core項目的全過程使用Dockerfile部署nodejs服務的方法步驟Docker中部署mysql服務的方法及遇到的坑

  3. 本文相關:
  4. docker命令行與守護進程的交互方法
  5. 基于docker安裝tensorflow的完整步驟
  6. docker初級網絡端口映射的配置
  7. docker部署elasticsearch和elasticsearch-head的實現
  8. docker容器中crontab無法正常運行解決方案
  9. docker之點到點的容器網絡的配置
  10. docker部署lnmp架構的方法
  11. docker 教程之存出和載入鏡像,移除及鏡像實現原理
  12. gitlab實踐教程使用git config進行相關的配置操作
  13. 使用docker創建集成服務lnmp環境
  14. docker的好處,為什么使用docker來部署服務器
  15. 使用docker該如何規劃容器的部署
  16. docker部署web服務,怎樣做到不間斷服務的更新
  17. 如何通過Docker進行容器編排
  18. 請問這個項目如何運行?用docker嗎?怎么用docker...
  19. 應該把什么樣的服務放到Docker上
  20. 如何部署 Docker Registry 服務
  21. docker在web開發中得使用流程是怎樣的
  22. docker部署 開發注意些什么
  23. 如何操作docker 容器的配置文件
  24. 網站首頁網頁制作腳本下載服務器操作系統網站運營平面設計媒體動畫電腦基礎硬件教程網絡安全dockerhyper-vvmwarevirtualboxxenserverkvmqemuopenvzxencloudstackopenstack云計算技術云其它首頁服務器云和虛擬化十分鐘學會用docker部署微服務linux服務器下利用docker部署.net core項目的全過程使用dockerfile部署nodejs服務的方法步驟docker中部署mysql服務的方法及遇到的坑docker命令行與守護進程的交互方法基于docker安裝tensorflow的完整步驟docker初級網絡端口映射的配置docker部署elasticsearch和elasticsearch-head的實現docker容器中crontab無法正常運行解決方案docker之點到點的容器網絡的配置docker部署lnmp架構的方法docker 教程之存出和載入鏡像,移除及鏡像實現原理gitlab實踐教程使用git config進行相關的配置操作使用docker創建集成服務lnmp環境docker 給運行中的容器設置端口映docker獲取鏡像報錯docker: errodocker.service啟動失敗:unit ndocker 清理命令集錦淺談docker-compose網絡設置之neubuntu14.04+docker的安裝及使用docker容器如何優雅的終止詳解docker容器訪問宿主機網絡的方法詳解如何使用docker部署一個web項詳解docker國內鏡像拉取和鏡像加使用tls加密通訊遠程連接docker的示例詳解docker 網絡命令詳解docker底層技術namespace cgroup應用詳解把jar包變成docker容器的方法docker下的 redis 之持久化存儲詳解docker使用阿里云鏡像倉庫的方法通過提前bake docker鏡像加快基礎設施的啟docker占滿磁盤空間的問題解決辦法docker-利用dockerfile來搭建tomcat服務的docker容器的創建、啟動、和停止的方法
    免責聲明 - 關于我們 - 聯系我們 - 廣告聯系 - 友情鏈接 - 幫助中心 - 頻道導航
    Copyright © 2017 www.yu113.com All Rights Reserved
    战天txt全集下载