No servers available for service: renren…。 Gateway 网关报503错误 ,已解决

目录

环境配置

问题描述

配置spring cloud gateway使用端口访问就可以,使用lb:// 就报503

xml 复制代码
gateway:
      routes:
        - id: admin_route
          uri: lb://gulimall-admin
#          uri: http://localhost:8080
          predicates:
            - Path=/api/**
          filters:
            - RewritePath=/api/?(?<segment>.*), /renren-fast/$\{segment}

原因:

gateway服务没有依赖loadbalancer包。

去renern-fast里面这么配置是错的。

sql 复制代码
<!--        <dependency>-->
<!--            <groupId>org.springframework.cloud</groupId>-->
<!--            <artifactId>spring-cloud-starter-loadbalancer</artifactId>-->
<!--            <version>3.1.1</version>-->
<!--        </dependency>-->

loadbalancer的作用

Spring Cloud LoadBalancer目前Spring官方是放在spring-cloud-commons里,Spring

Cloud最新版本为2021.0.2
Spring Cloud LoadBalancer 官网文档地址

https://docs.spring.io/spring-cloud-commons/docs/3.1.2/reference/html/#spring-cloud-loadbalancer
Spring Cloud官网文档地址

https://docs.spring.io/spring-cloud/docs/current/reference/html/

微服务生态组件之Spring Cloud LoadBalancer详解和源码分析

相关推荐
晏宁科技YaningAI17 小时前
分布式通信系统的容错机制
网络协议·微服务·系统架构·gateway·信息与通信·paas
爱淋雨的男人3 天前
网关gateway详解
gateway
不吃鱼的猫7483 天前
Janus WebRTC Gateway -- 从零搭建完整指南
gateway·webrtc
zhojiew3 天前
关于AWS Direct Connect with Transit Gateway和Direct Connect Gateway
云计算·gateway·aws
亚马逊云开发者3 天前
GameLift Servers DDoS防护实战:Player Gateway + Ping Beacons延迟优化 + C++ SDK集成
c++·gateway·ddos
戮戮3 天前
Spring Cloud Gateway 零拷贝参数校验:一种高性能网关架构实践
java·网络·架构·gateway
记忆张量MemTensor3 天前
SkillsVote:从技能目录走向终极技能网关(Ultimate Skill Gateway)
gateway
w6100104665 天前
CKA-2026-Gateway
kubernetes·gateway·cka
鬼先生_sir5 天前
SpringCloud-GateWay网关
java·spring cloud·gateway
不会写DN8 天前
让 gRPC 服务同时支持 HTTP/JSON 的gRPC-Gateway
http·json·gateway