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

相关推荐
JJJennie77722 分钟前
MAI Gateway私有化部署全攻略:大模型网关如何接入?附架构图
算法·gateway·ai网关·魔芋ai
Raas10034 分钟前
MAI Gateway实战部署:AI网关私有化部署?从0到1上手指南
人工智能·gateway·mai gateway·企业级ai产品
Raas1002 小时前
AI网关如何接入?MAI Gateway部署实操教程
java·开发语言·人工智能·gateway·ai网关·mai gateway·企业级产品
Raas1004 天前
AI网关部署方案?从部署到上线全流程
java·开发语言·人工智能·gateway·ai网关·企业级ai网关·企业级ai产品
Raas1004 天前
AI网关怎么部署?MAI Gateway部署实操教程
人工智能·开源·gateway·mai gateway·企业级ai产品
Raas1005 天前
MAI Gateway实战部署:AI网关怎么部署?从0到1上手指南
人工智能·gateway·ai网关·企业级ai网关·企业级产品·ai技术交流
4SAPI6 天前
会议智能处理大模型 API 生产选型指南:4SAPI、硅基流动与 OpenRouter 的架构权衡
人工智能·架构·自动化·gateway·php
JJJennie7776 天前
MAI Gateway实战部署:大模型网关部署方案?从0到1上手指南
数据库·人工智能·gateway·ai网关