第一篇 eureka服务注册与发现

2017-11-01  本文已影响22人  Kaven不是程序员

介绍

这里copy别人的一张图,我们就从这张图介绍eureka。


eureka 工作流程

快速构建

1. Eureka Server

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
@SpringBootApplication
@EnableEurekaServer
public class KavenRegistCenterServerApplication {
    public static void main(String[] args) {
           SpringApplication.run(KavenRegistCenterServerApplication.class, args);
    }
}
server:
  port: 1001
spring:
  application:
    name: kaven-regist-center-server
#1.5.X版本之后,严格执行安全校验    
management:
  security:
    enabled: false
eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false
    fetch-registry: false

到此一个简单的注册中心就搭建完成。

上一篇 下一篇

猜你喜欢

热点阅读