spring cloud创建eureka注册中心(一)

maven依赖

        
            org.springframework.cloud
            spring-cloud-starter-eureka-server
            1.4.4.RELEASE
        

引导代码

package com.cai.eureka;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

/**
 * Created by caiyl on 2018/6/10.
 */
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(EurekaApplication.class, args);
    }

}

application.yml配置

server:
  port: 8761

eureka:
  client:
    registerWithEureka: false
    fetchRegistry: false
  server:
waitTimeInMsWhenSyncEmpty: 0

启动后访问:http://localhost:8761/

微信图片_20180610153423.png

你可能感兴趣的:(spring cloud创建eureka注册中心(一))