EnableEurekaServer基本配置

pom.xml


            org.springframework.boot
            spring-boot-starter-web
            1.5.4.RELEASE
        
        
            org.springframework.cloud
            spring-cloud-starter-eureka-server
            1.3.1.RELEASE
        

spring配置

server:  
  port: 8761  
eureka:  
  client:  
    register-with-eureka: false  
    fetch-registry: false  
    service-url:  
      defaultZone: http://localhost:8761/eureka 

 

启动类

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


@EnableEurekaServer  //启动一个服务注册中心提供给其他应用进行对话
@SpringBootApplication
public class ServerApplication 
{
    public static void main( String[] args )
    {
        SpringApplication.run(ServerApplication.class, args);
    }
}

 

转载于:https://www.cnblogs.com/adeveloper/p/7206206.html

你可能感兴趣的:(EnableEurekaServer基本配置)