New Project:
delete src;
New Module:
dependencies,as this:
application.yml:
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka
server:
enable-self-preservation: false
DemoserverApplication:
package com.huizhi.demoserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class DemoserverApplication {
public static void main(String[] args) {
SpringApplication.run(DemoserverApplication.class, args);
}
}
run,localhost:8761:
来源:CSDN
作者:雷玉广
链接:https://blog.csdn.net/weixin_39593940/article/details/103835860