nacos配置

spring:
 datasource:
   url: jdbc:mysql://127.0.0.1:3306/${mysql.database}?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=GMT%2B8
   username: root
   password: 123456
   driver-class-name: com.mysql.cj.jdbc.Driver

#日志打印SQL
mybatis-plus:
 configuration:
   log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

nacos : 单机部署 standalone

nacos:集群 cluster

spring:
  cloud:
    #网关配置
    gateway:
      routes:
      #订单服务
        - id: order-service
          uri: lb://order-service  # 服务名称
          predicates:
            - Path=/order-service/**
          filters:
            - StripPrefix=1 #删除path几个单词
      #统一登录平台服务
        - id: uums-service
          uri: lb://uums-service  # 服务名称
          predicates:
            - Path=/uums-service/**
          filters:
            - StripPrefix=1 #删除path几个单词
    #sentinel
    sentinel:
      transport:
        dashboard: localhost:8840
#    限流:给限流统一返回结果
      scg:
        fallback:
          mode: response
          response-body: '{"code":429,"msg":"限流"}'

你可能感兴趣的:(java)