1、修改application.properties
spring.application.name=my-eureka-server
server.port=8761
#register self to eureka server
eureka.client.register-with-eureka=false
#get register info from eureka server
eureka.client.fetch-registry=false
2、修改启动类,添加@EnableEurekaServer注解
package com.clouddo.myeurekaserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class MyeurekaserverApplication {
public static void main(String[] args) {
SpringApplication.run(MyeurekaserverApplication.class, args);
}
}
3、浏览器中打开 http://localhost:8761/
如图: