This commit is contained in:
dxc
2020-10-19 16:11:35 +08:00
parent bdec98ee69
commit 460ea2742e
6 changed files with 139 additions and 0 deletions

View File

@ -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);
}
}

View 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/