springCloud 搭建Eureka

Posted -mzh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springCloud 搭建Eureka相关的知识,希望对你有一定的参考价值。

@MapperScan("com.cciinet.erp.*.*.dao") //扫描的mapper
@SpringBootApplication(exclude = org.activiti.spring.boot.SecurityAutoConfiguration.class, SecurityAutoConfiguration.class)
@EnableFeignClients
@ServletComponentScan
@EnableEurekaClient
//@EnableScheduling
@ImportResource // (locations = "classpath:spring-context-jedis.xml") //(locations = "classpath:spring-context-shiro.xml")
public class ErpApplication


// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder)
// // 注意这里要指向原先用main方法执行的Application启动类
// return builder.sources(ClientApplication.class, WebConfig.class);
//

public static void main(String[] args)
new SpringApplicationBuilder().sources(ErpApplication.class, WebConfigBeans.class).run(args);



@LoadBalanced
@Bean
RestTemplate restTemplate()
return new RestTemplate();


// 解决tomcat扫描mainfast的jar报错问题
@Bean
public TomcatServletWebServerFactory tomcatFactory()
return new TomcatServletWebServerFactory()
@Override
protected void postProcessContext(Context context)
((StandardJarScanner) context.getJarScanner()).setScanManifest(false);

;


以上是关于springCloud 搭建Eureka的主要内容,如果未能解决你的问题,请参考以下文章

springcloud01- SpringCloud快速搭建

记一次搭建简单cloudconsul项目错误

5.springcloud微服务架构搭建 之 《springboot集成Hystrix》

搭建SpringCloud微服务框架:SpringCloud-Gateway 服务网关处理

搭建SpringCloud微服务框架:SpringCloud-Gateway 服务网关处理

微服务SpringCloud项目架构搭建入门