nacos seata 微服務seata注冊報錯


nacos版本 1.4.1
seata版本 1.4.1
具體報錯日志:

...
no available service found in cluster 'default', please make sure registry cluster
...

配置文件:

registry.yml

#nacos seata都裝在docker里,這里可以直接通過docker服務名訪問
registry {
  # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  type = "nacos"

  nacos {
    application = "seata-server"
    serverAddr = "dev-nacos-server" 
    group = "SEATA_GROUP"
    namespace = ""
  }
}

config {
  type = "nacos"

  nacos {
    serverAddr = "dev-nacos-server"
    namespace = ""
    group = "SEATA_GROUP"
    username = "nacos"
    password = "nacos"
  }
}

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


  ## 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://**/seata?rewriteBatchedStatements=true"
    user = "**"
    password = "**"
    minConn = 5
    maxConn = 100
    globalTable = "global_table"
    branchTable = "branch_table"
    lockTable = "lock_table"
    queryLimit = 100
    maxWait = 5000
  }
}

application.yml

*其中主要問題就在這里:

可以看到默認的Group為SEATA_GROUP,需要與nacos中注冊上去的seata服務的group一致才能訪問到;

seata:
  tx-service-group: ${spring.application.name}-group
  registry:
    type: nacos
    nacos:
      server-addr: ${spring.profiles.active}-nacos-server:8848
      #      server-addr: localhost
      namespace:
  config:
    type: nacos
    nacos:
      server-addr: ${spring.profiles.active}-nacos-server:8848
      #      server-addr: localhost
      namespace:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM