Seata 以 Nacos 为注册中心启动

Seata 以 Nacos 为注册中心启动

修改 conf 下的 application.yml 配置

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:
  # nacos配置
  config:
    type: nacos
    nacos:
      server-addr: 127.0.0.1:8848
      namespace:
      group: SEATA_GROUP
      username: nacos
      password: nacos
      context-path:
      data-id: seataServer.properties
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key:
      #secret-key:
  registry:
    # nacos配置
    type: nacos
    nacos:
      application: seata-server
      server-addr: 127.0.0.1:8848
      group: SEATA_GROUP
      namespace:
      cluster: default
      username: nacos
      password: nacos
      context-path:
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key:
      #secret-key:
#  server:
#    service-port: 8091 #If not configured, the default is '${server.port} + 1000'
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    ignore:

新版本 nacos 使用 2.2.3

修改必要的配置文件选项:

修改数据源

#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0=root
db.password.0=082916

### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2

#*************** Naming Module Related Configurations ***************#

开启鉴权

### The auth system to use, currently only 'nacos' and 'ldap' is supported:
nacos.core.auth.system.type=nacos

### If turn on auth system: 开启,不然 login faied
nacos.core.auth.enabled=true

设置服务端验证 key

nacos.core.auth.server.identity.key=test
nacos.core.auth.server.identity.value=test

设置默认 token

### The default token (Base64 String):
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789

清理缓存,重新登陆,绑定角色

绑定 nacos ,因为新版本增加了鉴权,需要应用注册和配置绑定时配置用户名和密码

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-13 06:46:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-13 06:46:04       101 阅读
  3. 在Django里面运行非项目文件

    2024-01-13 06:46:04       82 阅读
  4. Python语言-面向对象

    2024-01-13 06:46:04       91 阅读

热门阅读

  1. 【算法题】49. 字母异位词分组

    2024-01-13 06:46:04       58 阅读
  2. 服务优雅停机SpringBoot

    2024-01-13 06:46:04       60 阅读
  3. 关于@KafkaListener动态订阅消费topic的调研

    2024-01-13 06:46:04       56 阅读
  4. 编程笔记 html5&css&js 036 CSS应用方式

    2024-01-13 06:46:04       53 阅读
  5. 基于多媒体的深度学习 Midreport自我总结分析

    2024-01-13 06:46:04       57 阅读
  6. 计算机网络概述

    2024-01-13 06:46:04       65 阅读
  7. 逢试必考的二分查找(算法村第九关青铜挑战)

    2024-01-13 06:46:04       59 阅读
  8. 计算机网络——HTTP协议

    2024-01-13 06:46:04       47 阅读