服务中心自我注册
- com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
eureka:
client:
register-with-eureka: false
fetch-registry: false #检索服务
添加security后,注册失败
- com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
- 启动添加如下
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@EnableWebSecurity
static class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().ignoringAntMatchers("/eureka/**");
super.configure(http);
}
}
}
忘记引入web