您好,登錄后才能下訂單哦!
依賴
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
啟動類增加注解
@SpringBootApplication
@EnableEurekaClient
public class SpringWebDemoApplication {
public static void main(String[] args) {
SpringApplication.run(SpringWebDemoApplication.class, args);
}
}
配置文件
eureka.instance.appname=web-demo
eureka.instance.app-group-name=web
eureka.instance.prefer-ip-address=true
eureka.instance.ip-address=127.0.0.1
eureka.instance.instance-id= ${spring.application.name}:${server.port}
#eureka.instance.home-page-url-path=/
#eureka.instance.health-check-url-path=/health
#eureka.instance.status-page-url-path=/status
eureka.instance.lease-expiration-duration-in-seconds=30
eureka.instance.lease-renewal-interval-in-seconds=10
eureka.client.serviceUrl.defaultZone=http://localhost:19002/eureka/,http://localhost:19001/eureka/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。