美文网首页我爱编程
spring cloud创建eureka注册中心(一)

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

作者: chase_ | 来源:发表于2018-06-10 15:35 被阅读0次

maven依赖

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka-server</artifactId>
            <version>1.4.4.RELEASE</version>
        </dependency>

引导代码

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注册中心(一)

    本文链接:https://www.haomeiwen.com/subject/sonfeftx.html