莫大人

1.2、负载均衡

server:
  port: 8080

spring: 
  application:
    name: gateway
  cloud:
    gateway:
      routes:
        - id: guo-system1
          uri: lb://system-server # lb: 使用负载均衡策略   system-server代表注册中心的具体服务名
          predicates:
            - Path=/gateway
            - Weight=group2, 2 # 分组与权重
          filters:
            - StripPrefix=1
        - id: guo-system2
          uri: lb://system-server
          predicates:
            - Path=/gateway
            - Weight=group2, 8
          filters:
            - StripPrefix=1

 

posted on 2021-06-18 18:00  莫大人  阅读(41)  评论(0编辑  收藏  举报

导航