2016년 7월 14일 목요일

Standing up eureka client

You can set eureka client to register the server to eureka.

- structure















- pom.xml


 4.0.0
 org.blog.test
 eureka-client
 1.0.0

 
  org.springframework.boot
  spring-boot-starter-parent
  1.3.6.RELEASE
 

 
  
   
    org.springframework.cloud
    spring-cloud-netflix
    1.1.2.RELEASE
    pom
    import
   
  
 

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



- application.properties

server.port=8080
eureka.instance.preferIpAddress=true
spring.application.name=eureka-client
spring.cloud.client.hostname=eureka-client-1


- EurekaClientApplication.java

package org.blog.test;

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

@SpringBootApplication
@EnableEurekaClient
public class EurekaClientApplication {

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


You can find the eureka web page by the url as below.

http://localhost:8761

댓글 없음 :

댓글 쓰기