我创建了一个eureka命名服务器 . 我在哪里创建了2个配置文件 . 并将这两个配置文件相互注册 .
我的Application.yml如下 -
eureka:instance:hostname:localhost client:registerWithEureka:true fetchRegistry:true serviceUrl:defaultZone:http:// $ :$ / eureka /
spring:profiles:eureka-host1 server:port:8761 eureka:instance:hostname:eureka-host1 client:serviceUrl:defaultZone:http://eureka-host2:8762/eureka/
spring:profiles:eureka-host2服务器:port:8762 eureka:instance:hostname:eureka-host2 client:serviceUrl:defaultZone:http://eureka-host1:8761/eureka/
运行两个配置文件后,如果我点击http://localhost:8761/或http://localhost:8762/,我可以看到Spring Eureka Server的两个页面 . 但是没有注册实例 . 但如果我点击http://eureka-host1:8761/或http://eureka-host2:8762/那我就能看到"This site can’t be reached"
一段时间后,我在Spring-Eureka-Server中收到以下消息-----
“紧急情况!EUREKA可能不正确地宣称当时没有 . 续约的数量超过了阈值,并且这些实际情况并未到期,只是为了安全 . ”
请帮忙 - - -
我的POM如下-----
http://maven.apache.org/xsd/maven-4.0.0.xsd“> 4.0.0
<groupId>com</groupId>
<artifactId>service-discovery-high-availability</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>rsmortgage-service-discovery-ha-latest</name>
<description>Spring Starter Project for Service Discovery for High Availability</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</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>Dalston.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>