您现在的位置是:首页 >技术交流 >SpringCloud 集成 Eureka Server网站首页技术交流

SpringCloud 集成 Eureka Server

深色風信子 2024-06-17 10:43:23
简介SpringCloud 集成 Eureka Server

SpringCloud 集成 Eureka Server

Eureka的优点:

简单易用:Eureka设计简单,容易上手和部署。
高可用性:Eureka支持高可用性配置,通过使用多个Eureka服务器实例来提供容错和故障恢复能力。
快速注册和发现:Eureka使用心跳机制来快速注册和发现服务,可以实时感知服务实例的变化。
社区支持:Eureka作为Netflix开源项目的一部分,有一个活跃的开发社区,提供技术支持和持续改进。

Eureka的缺点:
缺乏健壮性:在某些复杂网络环境下,Eureka的心跳机制可能导致一些问题,如延迟或数据不一致性。
功能有限:相对于其他服务注册中心,Eureka的功能相对较少,它主要专注于服务的注册和发现,缺乏一些高级功能。

Nacos的优点:
功能丰富:Nacos提供了广泛的功能,包括服务注册和发现、配置管理、动态路由等,可以满足更复杂的分布式系统需求。
可扩展性:Nacos支持集群部署和水平扩展,可以应对大规模系统和高并发流量。
健康检查:Nacos提供了健康检查机制,能够监测和移除不可用的服务实例,提高系统的可用性。
支持多种语言:Nacos支持多种编程语言和开发框架,适用于各种技术栈和开发团队。

Nacos的缺点:
复杂性:由于功能丰富,Nacos相对于Eureka而言更复杂一些,对于初学者来说上手和配置可能需要一些时间和学习成本。
较大的资源消耗:Nacos需要更多的系统资源来运行,特别是在大规模部署和高并发环境下,可能需要更多的计算和存储资源。

1 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.0.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<groupId>com.xu</groupId>
	<artifactId>eureka-server</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>eureka</name>

	<description>Eureka Server</description>

	<properties>
		<java.version>17</java.version>
		<spring-cloud.version>2022.0.2</spring-cloud.version>
	</properties>

	<dependencies>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
		</dependency>

		<dependency>
			<groupId>com.github.ben-manes.caffeine</groupId>
			<artifactId>caffeine</artifactId>
			<version>3.1.6</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.graalvm.buildtools</groupId>
				<artifactId>native-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>
							<groupId>org.projectlombok</groupId>
							<artifactId>lombok</artifactId>
						</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<repositories>
		<repository>
			<id>netflix-candidates</id>
			<name>Netflix Candidates</name>
			<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

</project>

2 application.yml

# 服务端口
server:
  port: 9000

# 服务名字
spring:
  application:
    name: eureka-server

# Eureka 配置
eureka:
  dashboard:
    enabled: true
  instance:
    # 防止 The replica size seems to be empty. Check the route 53 DNS Registry 提示
    prefer-ip-address: true
    hostname: 127.0.0.1
  client:
    # false 表示不向注册中心注册自己。
    register-with-eureka: false
    # false 表示自己端就是维护服务实例的注册中心,不需要去检索服务。
    fetch-registry: false
    service-url:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
  server:
    # 自我保护机制
    enable-self-preservation: false
    # 自我保护系数(默认0.85)
    renewal-percent-threshold: 0.85
    # 扫描失效服务时间间隔(单位毫秒,默认60*1000)60秒
    eviction-interval-timer-in-ms: 30000
    # 设置eureka server同步失败的等待时间,默认5分钟,在这期间它不向客户端提供服务注册信息
    wait-time-in-ms-when-sync-empty: 5
    # 设置eureka server同步失败的重试次数,默认为5次
    number-of-replication-retries: 5

3 appliction.java

package com.xu.eureka;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

/**
 * @author hyacinth
 */
@EnableEurekaServer
@SpringBootApplication
public class EurekaApplication {

	public static void main(String[] args) {
		SpringApplication.run(EurekaApplication.class, args);
	}

}

4 启动

D:EnvironmentJavajdk-17.0.7injava.exe "-javaagent:D:IDEIntelliJ IDEA Community Edition 2023.1.1libidea_rt.jar=9491:D:IDEIntelliJ IDEA Community Edition 2023.1.1in" -Dfile.encoding=UTF-8 -classpath E:SoureCodeLearneureka-server	argetclasses;E:MavenRepositoryorgspringframeworkootspring-boot-starter-web3.0.6spring-boot-starter-web-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter3.0.6spring-boot-starter-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-logging3.0.6spring-boot-starter-logging-3.0.6.jar;E:MavenRepositorychqoslogbacklogback-classic1.4.7logback-classic-1.4.7.jar;E:MavenRepositorychqoslogbacklogback-core1.4.7logback-core-1.4.7.jar;E:MavenRepositoryorgapachelogginglog4jlog4j-to-slf4j2.19.0log4j-to-slf4j-2.19.0.jar;E:MavenRepositoryorgapachelogginglog4jlog4j-api2.19.0log4j-api-2.19.0.jar;E:MavenRepositoryorgslf4jjul-to-slf4j2.0.7jul-to-slf4j-2.0.7.jar;E:MavenRepositoryjakartaannotationjakarta.annotation-api2.1.1jakarta.annotation-api-2.1.1.jar;E:MavenRepositoryorgyamlsnakeyaml1.33snakeyaml-1.33.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-json3.0.6spring-boot-starter-json-3.0.6.jar;E:MavenRepositorycomfasterxmljacksoncorejackson-databind2.14.2jackson-databind-2.14.2.jar;E:MavenRepositorycomfasterxmljacksoncorejackson-annotations2.14.2jackson-annotations-2.14.2.jar;E:MavenRepositorycomfasterxmljacksoncorejackson-core2.14.2jackson-core-2.14.2.jar;E:MavenRepositorycomfasterxmljacksondatatypejackson-datatype-jdk82.14.2jackson-datatype-jdk8-2.14.2.jar;E:MavenRepositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.14.2jackson-datatype-jsr310-2.14.2.jar;E:MavenRepositorycomfasterxmljacksonmodulejackson-module-parameter-names2.14.2jackson-module-parameter-names-2.14.2.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-tomcat3.0.6spring-boot-starter-tomcat-3.0.6.jar;E:MavenRepositoryorgapache	omcatembed	omcat-embed-core10.1.8	omcat-embed-core-10.1.8.jar;E:MavenRepositoryorgapache	omcatembed	omcat-embed-el10.1.8	omcat-embed-el-10.1.8.jar;E:MavenRepositoryorgapache	omcatembed	omcat-embed-websocket10.1.8	omcat-embed-websocket-10.1.8.jar;E:MavenRepositoryorgspringframeworkspring-web6.0.8spring-web-6.0.8.jar;E:MavenRepositoryorgspringframeworkspring-beans6.0.8spring-beans-6.0.8.jar;E:MavenRepositoryiomicrometermicrometer-observation1.10.6micrometer-observation-1.10.6.jar;E:MavenRepositoryiomicrometermicrometer-commons1.10.6micrometer-commons-1.10.6.jar;E:MavenRepositoryorgspringframeworkspring-webmvc6.0.8spring-webmvc-6.0.8.jar;E:MavenRepositoryorgspringframeworkspring-aop6.0.8spring-aop-6.0.8.jar;E:MavenRepositoryorgspringframeworkspring-context6.0.8spring-context-6.0.8.jar;E:MavenRepositoryorgspringframeworkspring-expression6.0.8spring-expression-6.0.8.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-starter-netflix-eureka-server4.0.1spring-cloud-starter-netflix-eureka-server-4.0.1.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-starter4.0.2spring-cloud-starter-4.0.2.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-context4.0.2spring-cloud-context-4.0.2.jar;E:MavenRepositoryorgspringframeworksecurityspring-security-crypto6.0.3spring-security-crypto-6.0.3.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-commons4.0.2spring-cloud-commons-4.0.2.jar;E:MavenRepositoryorgspringframeworksecurityspring-security-rsa1.0.11.RELEASEspring-security-rsa-1.0.11.RELEASE.jar;E:MavenRepositoryorgouncycastlecpkix-jdk15on1.69cpkix-jdk15on-1.69.jar;E:MavenRepositoryorgouncycastlecprov-jdk15on1.69cprov-jdk15on-1.69.jar;E:MavenRepositoryorgouncycastlecutil-jdk15on1.69cutil-jdk15on-1.69.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-netflix-eureka-server4.0.1spring-cloud-netflix-eureka-server-4.0.1.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-actuator3.0.6spring-boot-starter-actuator-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot-actuator-autoconfigure3.0.6spring-boot-actuator-autoconfigure-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot-actuator3.0.6spring-boot-actuator-3.0.6.jar;E:MavenRepositoryiomicrometermicrometer-core1.10.6micrometer-core-1.10.6.jar;E:MavenRepositoryorghdrhistogramHdrHistogram2.1.12HdrHistogram-2.1.12.jar;E:MavenRepositoryorglatencyutilsLatencyUtils2.0.3LatencyUtils-2.0.3.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-freemarker3.0.6spring-boot-starter-freemarker-3.0.6.jar;E:MavenRepositoryorgfreemarkerfreemarker2.3.32freemarker-2.3.32.jar;E:MavenRepositoryorgspringframeworkspring-context-support6.0.8spring-context-support-6.0.8.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-netflix-eureka-client4.0.1spring-cloud-netflix-eureka-client-4.0.1.jar;E:MavenRepositorycom
etflixeurekaeureka-client2.0.0eureka-client-2.0.0.jar;E:MavenRepositorycom
etflix
etflix-commons
etflix-eventbus0.3.0
etflix-eventbus-0.3.0.jar;E:MavenRepositorycom
etflix
etflix-commons
etflix-infix0.3.0
etflix-infix-0.3.0.jar;E:MavenRepositorycommons-jxpathcommons-jxpath1.3commons-jxpath-1.3.jar;E:MavenRepositoryjoda-timejoda-time2.3joda-time-2.3.jar;E:MavenRepositoryorgantlrantlr-runtime3.4antlr-runtime-3.4.jar;E:MavenRepositoryorgantlrstringtemplate3.2.1stringtemplate-3.2.1.jar;E:MavenRepositoryantlrantlr2.7.7antlr-2.7.7.jar;E:MavenRepositorycomgooglecodegsongson2.9.1gson-2.9.1.jar;E:MavenRepositoryorgapachecommonscommons-math2.2commons-math-2.2.jar;E:MavenRepositorycom	houghtworksxstreamxstream1.4.19xstream-1.4.19.jar;E:MavenRepositoryiogithubx-streammxparser1.2.2mxparser-1.2.2.jar;E:MavenRepositoryxmlpullxmlpull1.1.3.1xmlpull-1.1.3.1.jar;E:MavenRepositorycom
etflixservoservo-core0.12.21servo-core-0.12.21.jar;E:MavenRepositorycomgoogleguavaguava19.0guava-19.0.jar;E:MavenRepositoryorgapachehttpcomponentshttpclient4.5.14httpclient-4.5.14.jar;E:MavenRepositoryorgapachehttpcomponentshttpcore4.4.16httpcore-4.4.16.jar;E:MavenRepositorycommons-configurationcommons-configuration1.10commons-configuration-1.10.jar;E:MavenRepositorycommons-langcommons-lang2.6commons-lang-2.6.jar;E:MavenRepositoryorgcodehausjettisonjettison1.4.0jettison-1.4.0.jar;E:MavenRepositoryorgapachehttpcomponentsclient5httpclient55.1.4httpclient5-5.1.4.jar;E:MavenRepositoryorgapachehttpcomponentscore5httpcore55.1.5httpcore5-5.1.5.jar;E:MavenRepositoryorgapachehttpcomponentscore5httpcore5-h25.1.5httpcore5-h2-5.1.5.jar;E:MavenRepositorycommons-codeccommons-codec1.15commons-codec-1.15.jar;E:MavenRepositorycom
etflixeurekaeureka-client-jersey32.0.0eureka-client-jersey3-2.0.0.jar;E:MavenRepositoryorgglassfishjerseyconnectorsjersey-apache-connector3.1.1jersey-apache-connector-3.1.1.jar;E:MavenRepositorycom
etflixeurekaeureka-core-jersey32.0.0eureka-core-jersey3-2.0.0.jar;E:MavenRepositorycom
etflixeurekaeureka-core2.0.0eureka-core-2.0.0.jar;E:MavenRepositoryjakartaservletjakarta.servlet-api6.0.0jakarta.servlet-api-6.0.0.jar;E:MavenRepositoryorgglassfishjerseycontainersjersey-container-servlet3.1.1jersey-container-servlet-3.1.1.jar;E:MavenRepositoryorgglassfishjerseycontainersjersey-container-servlet-core3.1.1jersey-container-servlet-core-3.1.1.jar;E:MavenRepositoryorgglassfishjerseycorejersey-common3.1.1jersey-common-3.1.1.jar;E:MavenRepositoryorgglassfishhk2osgi-resource-locator1.0.3osgi-resource-locator-1.0.3.jar;E:MavenRepositoryjakartaws
sjakarta.ws.rs-api3.1.0jakarta.ws.rs-api-3.1.0.jar;E:MavenRepositoryorgglassfishjerseycorejersey-server3.1.1jersey-server-3.1.1.jar;E:MavenRepositoryjakartavalidationjakarta.validation-api3.0.2jakarta.validation-api-3.0.2.jar;E:MavenRepositoryorgglassfishjerseycorejersey-client3.1.1jersey-client-3.1.1.jar;E:MavenRepositoryorgglassfishjerseyinjectjersey-hk23.1.1jersey-hk2-3.1.1.jar;E:MavenRepositoryorgglassfishhk2hk2-locator3.0.3hk2-locator-3.0.3.jar;E:MavenRepositoryorgglassfishhk2externalaopalliance-repackaged3.0.3aopalliance-repackaged-3.0.3.jar;E:MavenRepositoryorgglassfishhk2hk2-utils3.0.3hk2-utils-3.0.3.jar;E:MavenRepositoryorgjavassistjavassist3.29.0-GAjavassist-3.29.0-GA.jar;E:MavenRepositoryorgglassfishhk2spring-bridge3.0.3spring-bridge-3.0.3.jar;E:MavenRepositoryorgglassfishhk2hk2-api3.0.3hk2-api-3.0.3.jar;E:MavenRepositoryjakartainjectjakarta.inject-api2.0.1jakarta.inject-api-2.0.1.jar;E:MavenRepositorycomfasterxmljacksondataformatjackson-dataformat-xml2.14.2jackson-dataformat-xml-2.14.2.jar;E:MavenRepositoryorgcodehauswoodstoxstax2-api4.2.1stax2-api-4.2.1.jar;E:MavenRepositorycomfasterxmlwoodstoxwoodstox-core6.5.0woodstox-core-6.5.0.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-starter-loadbalancer4.0.2spring-cloud-starter-loadbalancer-4.0.2.jar;E:MavenRepositoryorgspringframeworkcloudspring-cloud-loadbalancer4.0.2spring-cloud-loadbalancer-4.0.2.jar;E:MavenRepositoryioprojectreactor
eactor-core3.5.5
eactor-core-3.5.5.jar;E:MavenRepositoryorg
eactivestreams
eactive-streams1.0.4
eactive-streams-1.0.4.jar;E:MavenRepositoryioprojectreactoraddons
eactor-extra3.5.1
eactor-extra-3.5.1.jar;E:MavenRepositoryorgspringframeworkootspring-boot-starter-cache3.0.6spring-boot-starter-cache-3.0.6.jar;E:MavenRepositorycomstoyanrevictor1.0.0evictor-1.0.0.jar;E:MavenRepositoryorgglassfishjaxbjaxb-runtime4.0.2jaxb-runtime-4.0.2.jar;E:MavenRepositoryorgglassfishjaxbjaxb-core4.0.2jaxb-core-4.0.2.jar;E:MavenRepositoryorgeclipseangusangus-activation2.0.0angus-activation-2.0.0.jar;E:MavenRepositoryorgglassfishjaxb	xw24.0.2	xw2-4.0.2.jar;E:MavenRepositorycomsunistackistack-commons-runtime4.1.1istack-commons-runtime-4.1.1.jar;E:MavenRepositorycomgithuben-manescaffeinecaffeine3.1.6caffeine-3.1.6.jar;E:MavenRepositoryorgcheckerframeworkchecker-qual3.33.0checker-qual-3.33.0.jar;E:MavenRepositorycomgoogleerrorproneerror_prone_annotations2.18.0error_prone_annotations-2.18.0.jar;E:MavenRepositoryorgspringframeworkootspring-boot-devtools3.0.6spring-boot-devtools-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot3.0.6spring-boot-3.0.6.jar;E:MavenRepositoryorgspringframeworkootspring-boot-autoconfigure3.0.6spring-boot-autoconfigure-3.0.6.jar;E:MavenRepositoryorgprojectlomboklombok1.18.26lombok-1.18.26.jar;E:MavenRepositoryorgslf4jslf4j-api2.0.7slf4j-api-2.0.7.jar;E:MavenRepositoryjakartaxmlindjakarta.xml.bind-api4.0.0jakarta.xml.bind-api-4.0.0.jar;E:MavenRepositoryjakartaactivationjakarta.activation-api2.1.1jakarta.activation-api-2.1.1.jar;E:MavenRepositoryorgspringframeworkspring-core6.0.8spring-core-6.0.8.jar;E:MavenRepositoryorgspringframeworkspring-jcl6.0.8spring-jcl-6.0.8.jar com.xu.eureka.EurekaApplication

  .   ____          _            __ _ _
 /\ / ___'_ __ _ _(_)_ __  __ _    
( ( )\___ | '_ | '_| | '_ / _` |    
 \/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.6)

2023-05-18T11:54:34.761+08:00  INFO 27992 --- [  restartedMain] com.xu.eureka.EurekaApplication          : Starting EurekaApplication using Java 17.0.7 with PID 27992 (E:SoureCodeLearneureka-server	argetclasses started by xuyq in E:SoureCodeLearneureka-server)
2023-05-18T11:54:34.765+08:00  INFO 27992 --- [  restartedMain] com.xu.eureka.EurekaApplication          : No active profile set, falling back to 1 default profile: "default"
2023-05-18T11:54:34.824+08:00  INFO 27992 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-05-18T11:54:34.824+08:00  INFO 27992 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-05-18T11:54:35.801+08:00  INFO 27992 --- [  restartedMain] o.s.cloud.context.scope.GenericScope     : BeanFactory id=92ee8310-e18b-3993-a1c2-03e356109b2c
2023-05-18T11:54:36.288+08:00  INFO 27992 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9000 (http)
2023-05-18T11:54:36.295+08:00  INFO 27992 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-05-18T11:54:36.295+08:00  INFO 27992 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.8]
2023-05-18T11:54:36.353+08:00  INFO 27992 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-05-18T11:54:36.354+08:00  INFO 27992 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1528 ms
2023-05-18T11:54:37.157+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2023-05-18T11:54:37.160+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2023-05-18T11:54:37.288+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2023-05-18T11:54:37.288+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2023-05-18T11:54:38.026+08:00  INFO 27992 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-05-18T11:54:38.123+08:00  INFO 27992 --- [  restartedMain] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses RestTemplate.
2023-05-18T11:54:38.211+08:00  INFO 27992 --- [  restartedMain] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2023-05-18T11:54:38.240+08:00  INFO 27992 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2023-05-18T11:54:38.240+08:00  INFO 27992 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Client configured to neither register nor query for data.
2023-05-18T11:54:38.249+08:00  INFO 27992 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1684382078248 with initial instances count: 0
2023-05-18T11:54:38.281+08:00  INFO 27992 --- [  restartedMain] c.n.eureka.DefaultEurekaServerContext    : Initializing ...
2023-05-18T11:54:38.284+08:00  INFO 27992 --- [  restartedMain] c.n.eureka.cluster.PeerEurekaNodes       : Adding new peer nodes [http://127.0.0.1:9000/eureka/]
2023-05-18T11:54:38.369+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2023-05-18T11:54:38.370+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2023-05-18T11:54:38.370+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2023-05-18T11:54:38.370+08:00  INFO 27992 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2023-05-18T11:54:38.472+08:00  INFO 27992 --- [  restartedMain] c.n.eureka.cluster.PeerEurekaNodes       : Replica node URL:  http://127.0.0.1:9000/eureka/
2023-05-18T11:54:38.477+08:00  INFO 27992 --- [  restartedMain] c.n.e.registry.AbstractInstanceRegistry  : Finished initializing remote region registries. All known remote regions: []
2023-05-18T11:54:38.478+08:00  INFO 27992 --- [  restartedMain] c.n.eureka.DefaultEurekaServerContext    : Initialized
2023-05-18T11:54:38.490+08:00  INFO 27992 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2023-05-18T11:54:38.538+08:00  INFO 27992 --- [  restartedMain] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application EUREKA-SERVER with eureka with status UP
2023-05-18T11:54:38.552+08:00  INFO 27992 --- [      Thread-15] o.s.c.n.e.server.EurekaServerBootstrap   : isAws returned false
2023-05-18T11:54:38.553+08:00  INFO 27992 --- [      Thread-15] o.s.c.n.e.server.EurekaServerBootstrap   : Initialized server context
2023-05-18T11:54:38.553+08:00  INFO 27992 --- [      Thread-15] c.n.e.r.PeerAwareInstanceRegistryImpl    : Got 1 instances from neighboring DS node
2023-05-18T11:54:38.553+08:00  INFO 27992 --- [      Thread-15] c.n.e.r.PeerAwareInstanceRegistryImpl    : Renew threshold is: 1
2023-05-18T11:54:38.553+08:00  INFO 27992 --- [      Thread-15] c.n.e.r.PeerAwareInstanceRegistryImpl    : Changing status to UP
2023-05-18T11:54:38.558+08:00  INFO 27992 --- [      Thread-15] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2023-05-18T11:54:38.567+08:00  INFO 27992 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 9000 (http) with context path ''
2023-05-18T11:54:38.568+08:00  INFO 27992 --- [  restartedMain] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 9000
2023-05-18T11:54:38.664+08:00  INFO 27992 --- [  restartedMain] com.xu.eureka.EurekaApplication          : Started EurekaApplication in 4.386 seconds (process running for 4.887)

http://127.0.0.1:9000/ 查看注册中心
在这里插入图片描述

风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。