基础版本完成

This commit is contained in:
2023-08-15 10:27:06 +08:00
parent 9cf9f6b824
commit fd494e7cb2
11 changed files with 97 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>

View File

@@ -0,0 +1,20 @@
package com.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
/**
* ClassName: com.test.EurekaApplication
* Package: PACKAGE_NAME
*
* @author yovinchen
* @Create 2023/8/15 09:52
*/
@EnableEurekaServer
@SpringBootApplication
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class, args);
}
}

View File

@@ -0,0 +1,12 @@
server:
port: 8888
eureka:
# 开启之前需要修改一下客户端设置(虽然是服务端
client:
# 由于我们是作为服务端角色所以不需要获取服务端改为false默认为true
fetch-registry: false
# 暂时不需要将自己也注册到Eureka
register-with-eureka: false
# 将eureka服务端指向自己
service-url:
defaultZone: http://localhost:8888/eureka