Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 69 章 FAQ

目录

69.1. Cannot execute request on any known server
69.2. @EnableDiscoveryClient与@EnableEurekaClient 区别
69.3. Feign请求超时
69.4. 已停止的微服务节点注销慢或不注销
69.5. Feign 启动出错 PathVariable annotation was empty on param 0.
69.6. Feign 提示 Consider defining a bean of type 'common.feign.Cms' in your configuration.
69.7. Load balancer does not have available server for client
69.8. Eureka Client (Dalston.SR1)
69.8.1. Maven
69.8.2. Application
69.8.3. RestController
69.8.4. application.properties
69.8.5. 测试
69.9. Config Server(1.3.1.RELEASE)
69.9.1. Server
69.9.2. Client
69.10. feign.RetryableException: Read timed out executing

69.1. Cannot execute request on any known server

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

解决方法,禁用 CSRF

		
package cn.netkiller.eureka.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
@EnableWebSecurity
public class SecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http.csrf().disable();
		super.configure(http);
	}

	@Override
	protected void configure(AuthenticationManagerBuilder auth) throws Exception {
		super.configure(auth);
	}

}