一、Cannot execute request on any known server
产生原因分析:
1、服务端启动报这个错误,原因没有以下配置,配置的含义为不将服务端作为客户端使用
register-with-eureka: false
fetch-registry: false
2、客户端报这个错误
原因:
a、eureka没有启动
b、配置的defalutZone地址错误
c、使用security保护eureka时,需要进行crsf验证,在客户端中配置以下
http://user:password@localhost:8761/eureka/
PS:在服务端配置以下代码,不进行crsf验证(解决方案见github springcloud 官方说明)
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
}
}
2028

被折叠的 条评论
为什么被折叠?



