spring cloud gateway + nacos 503 SERVICE_UNAVAILABLE “Unable to find instance for xxx”
今天闲来无事,就想自己来搭建一个cloud系统来玩完。
使用的是spring cloud gateway + nacos的方式搭建了个demo,结果在所有项目启动后,通过网关去请求微服务的时候却显示服务找不到,一直返回**“503 SERVICE_UNAVAILABLE “Unable to find instance for xxx””**,微服务也没有错误日志
在网上找了半天基本都是说版本问题,可是我的版本改了还是没用。
最后打算将所有maven包删除重新添加时发现,我在gateway服务上配置的spring-cloud-starter-alibaba-nacos-discovery包是org.springframework.cloud(spring cloud)提供的,而我其他服务却是com.alibaba.cloud(alibaba)提供的。原来maven配置文件我是从其他地方copy过来的,也没想过竟然有两个提供者,搞了个大乌龙(ㄒoㄒ)