2016년 7월 14일 목요일

Standing up eureka server

You can set eureka server to get the info of micro service servers.

- structure




- pom.xml


 4.0.0
 org.blog.test
 eureka-server
 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-server
  
 



- application.properties

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


- EurekaServerApplication.java

package org.blot.test;

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

@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {

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


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

http://localhost:8761


- result


댓글 없음 :

댓글 쓰기