eureka server配置

1. 父pom

com.kq
spring
pom
1.0.0

    eurake




    org.springframework.cloud
    spring-cloud-starter-parent
    Camden.SR5
    



    service-image
    UTF-8
    UTF-8
    1.8


    
        org.springframework.boot
        spring-boot-starter-web
    
    
        org.springframework.boot
        spring-boot-starter-actuator
    

    
        org.springframework.boot
        spring-boot-starter-test
        test
    


 

2. 当前pom


    spring
    com.kq
    1.0.0
    ../pom.xml

4.0.0

com.kq
eurake




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


 

3. application.yml

server:
  port: 11000

eureka:
  instance:
    hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:11001/eureka/
  server:
    enable-self-preservation: false #自我保护机制
    eviction-interval-timer-in-ms: 30000  #及时踢出已关停的节点

 

4. 启动类

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

@SpringBootApplication
@EnableEurekaServer
public class EurakeServer {

    public static void main(String[] args) {
        new SpringApplicationBuilder(EurakeServer.class).web(true).run(args);
    }

}

 

你可能感兴趣的:(springcloud,springboot)