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详解和源码分析

相关推荐
whz-emm16 小时前
vLLM加载lora
gateway
青衫客362 天前
Portkey-AI gateway 的一次“假压缩头”翻车的完整排障记:由 httpx 解压异常引发的根因分析
大模型·llm·gateway·httpx
PXM的算法星球7 天前
spring gateway配合nacos实现负载均衡
spring·gateway·负载均衡
1990_super8 天前
使用ceph-deploy安装和配置RADOS Gateway (RGW)并使用S3访问集群
ceph·gateway
北极糊的狐11 天前
接口返回504 Gateway Time-out 错误,这意味着请求在网关或代理服务器等待上游服务器响应时超时。以下是可能的原因和排查建议:
数据库·gateway
sg_knight11 天前
Spring Cloud Gateway全栈实践:动态路由能力与WebFlux深度整合
java·spring boot·网关·spring·spring cloud·微服务·gateway
放纵日放纵14 天前
微服务—Gateway
微服务·架构·gateway
你我约定有三14 天前
分布式微服务--GateWay(1)
java·开发语言·分布式·微服务·架构·gateway
William一直在路上17 天前
KONG API Gateway中的核心概念
网络·gateway·kong