世界优秀摄影作品网站,做网站有哪些法规,诸城做网站找个人,九亭 网站建设配置文件配置了自动转发
spring.cloud.gateway.discovery.locator.enabled true
但是用微服务路径访问时一直报503
[fa9cc893-1] There was an unexpected error (typeService Unavailable, status503).
这个503看得我是一头雾水。原因在于这个默认错误页的报错显示不全…配置文件配置了自动转发
spring.cloud.gateway.discovery.locator.enabled true
但是用微服务路径访问时一直报503
[fa9cc893-1] There was an unexpected error (typeService Unavailable, status503).
这个503看得我是一头雾水。原因在于这个默认错误页的报错显示不全需要开启两个配置帮助检查
#输出错误页的异常信息
server.error.include-messagealways
#输出错误页的异常栈开发环境开启生产环境关闭
server.error.include-stacktracealways
开启后看报错内容好多了
[fa9cc893-1] There was an unexpected error (typeService Unavailable, status503).
Unable to find instance for user-center
org.springframework.cloud.gateway.support.NotFoundException: 503 SERVICE_UNAVAILABLE Unable to find instance for user-centerat org.springframework.cloud.gateway.support.NotFoundException.create(NotFoundException.java:45)
报错原因为找不到微服务实例
根据关键词搜索找到这么一篇Sping Cloud Gateway Unable to find instance for_jonhy.luo的博客-CSDN博客
废弃ribbon这个跟我这个有点像我的spring cloud alibaba版本为2021.0.5.0spring cloud 版本为2021.0.5 增加loadbalance依赖
dependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-loadbalancer/artifactId
/dependency
重新启动gateway工程默认转发正常了。