配置springCloudk客户端

server.port=8082
#指定服务名称为Server-Provider,后续服务消费者要获取上面TestController中接口的时候会用到这个服务名;
spring.application.name=Service-Provider

eureka.client.fetch-registry=true

eureka.client.register-with-eureka=true

eureka.client.serviceUrl.defaultZone=http://peer1:8080/eureka/,http://peer2:8081/eureka/

 

@SpringBootApplication
@EnableDiscoveryClient
public class ClientApplication {

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

}

    
        
            org.springframework.cloud
            spring-cloud-dependencies
            Edgware.SR3
            pom
            import
        
    


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

 

你可能感兴趣的:(springCloud)