报错如下:
This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue May 11 23:40:56 CST 2021 There was an unexpected error (type=Internal Server Error, status=500). No instances available for SPRINGCLOUD-PRODUCT-PROVIDERSproduct java.lang.IllegalStateException: No instances available for SPRINGCLOUD-PRODUCT-PROVIDERSproduct at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:119) at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:99) at org.springframework.cloud.client.loadbalancer.LoadBalancerInterceptor.intercept(LoadBalancerInterceptor.java:58) at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93) at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:77) at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:742)
在消费者controller里面retemplte调用地址有单机版localhost加端口换成了服务名
原因是粗心,url后面没有带/