Eureka常见错误
1.EurekaHttpClient : Request execution error导致No instances available
原因:eureka会默认将自己本身注册至注册中心
解决:
eureka:
client:
service-url:
defaultZone: http://localhost:${server.port}/eureka/
fetch-registry: false
register-with-eureka: false
2.eureka注册中心启动错误Unable to Start embedded TomCat
原因:JDK版本问题
解决:jdk9/10—1.8
(分布在setting–java compile、maven中import和Project Structure中)需要全部更正为1.8或者lambda8
!!!特别注意:%JAVA_HOME\bin%;一定要放在path路径的最前面!!!
3.服务提供者出现:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
原因:jdbc未引入或者数据库等链接错误
解决
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
``
### 4.消费者:No instances available for user-service] with root cause