eureka
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.ebtp.ubooteureka;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||
|
||||
@EnableEurekaServer
|
||||
@SpringBootApplication
|
||||
public class UbootEurekaApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UbootEurekaApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
14
uboot-eureka/src/main/resources/application.yml
Normal file
14
uboot-eureka/src/main/resources/application.yml
Normal file
@ -0,0 +1,14 @@
|
||||
server:
|
||||
port: 8761 #指定该Eureka实例的端口
|
||||
spring:
|
||||
application:
|
||||
name: uboot-eureka
|
||||
|
||||
eureka:
|
||||
instance:
|
||||
hostname: localhost #设置当前实例的主机名称
|
||||
client:
|
||||
registerWithEureka: false #禁止注册自身
|
||||
fetchRegistry: false #因为该服务没有注册到其他注册中心,所以关闭从注册中心拉取服务列表。
|
||||
serviceUrl: #服务注册中心地址
|
||||
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
|
Reference in New Issue
Block a user