基础版本完成
This commit is contained in:
		@@ -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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								eureka-service/src/main/java/com/test/EurekaApplication.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								eureka-service/src/main/java/com/test/EurekaApplication.java
									
									
									
									
									
										Normal 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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								eureka-service/src/main/resources/application.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								eureka-service/src/main/resources/application.yml
									
									
									
									
									
										Normal 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user