目录
需要两个eureka server项目,之前已经有一个springcloud-eureka
1、在springcloud项目下新建一个聚合项目springcloud-eureka2
2、修改springcloud-eureka2的pom文件,引入eureka-server依赖
3、增加springcloud-eureka2的启动类,开启注解@EnableEurekaServer
4、在springcloud-eureka2添加application.yml文件
5、修改springcloud-eureka的application.yml文件
7、访问Eureka Server1: http://localhost:8090/
8、访问Eureka Server2: http://localhost:8060/
需要两个eureka server项目,之前已经有一个springcloud-eureka
1、在springcloud项目下新建一个聚合项目springcloud-eureka2

2、修改springcloud-eureka2的pom文件,引入eureka-server依赖
<?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%20http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>springcloud</artifactId>
<groupId>com.chen</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>springcloud-eureka2</artifactId>
<name>springcloud-eureka2</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<dependencies>
<dependency>

该博客介绍了如何配置Eureka注册中心集群,包括创建新的Eureka Server项目,设置依赖,启用注解,配置application.yml文件,以及实现两个Eureka Server的相互注册,确保高可用性。通过访问不同端口的Eureka Server,验证了集群配置的成功。
2481

被折叠的 条评论
为什么被折叠?



