1.创建maven项目
1.创建项目

2.选择maven

3.填写项目信息

4.配置maven

2.右键项目新增服务模块(Eureka服务)
1.右键项目选择模板

2.创建springboot

3.填写模板信息

4.选择组件 完成

5.启动类中添加一个@EnableEurekaServer注解
package com.ming.eureka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class, args);
}
}
6.application.yml配置信息
server:
port: 10086
spring:
application:
name: eureka-server
eureka:
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://127.0.0.1:${server.port}/eureka

