Skip to content

Commit cf1d49c

Browse files
配置多个高可用的服务注册中心时,出现节点重复
1 parent b63cd5f commit cf1d49c

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

eureka-server/src/main/resources/application.yml renamed to eureka-server/src/main/resources/application-peer1.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ server:
99
# 在默认设置下,该服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为
1010
eureka:
1111
instance:
12-
hostname: localhost
12+
hostname: peer1
1313
client:
1414
register-with-eureka: false
1515
fetch-registry: false
16+
serviceUrl:
17+
defaultZone:
18+
http://peer2:1112/eureka/
1619

1720

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
spring:
2+
application:
3+
name: eureka-server
4+
server:
5+
port: 1112
6+
7+
eureka:
8+
instance:
9+
hostname: peer2
10+
11+
eureka:
12+
client:
13+
serviceUrl:
14+
defaultZone: http://peer1:1111/eureka/

readMe.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ com.netflix.discovery.shared.transport.TransportException: Cannot execute reques
1717
解决方案: 在spring.cloud.config.profile 这个配置中, dev表示开发环境配置文件、test表示测试环境、pro表示正式环境 <br>
1818
6.分布式Config中,客户端无法访问服务端配置中心。如何破解? <br>
1919
7.断路器hystrix不起作用. <br>
20-
解决方案:这是由于版本原因造成的。需要在配置中开启 feign.hystrix.enabled=true <br>
20+
解决方案:这是由于版本原因造成的。需要在配置中开启 feign.hystrix.enabled=true <br>
21+
8.maven打包成jar包后,无法运行? <br>
22+
路径含有中文,无法打包。 <br>
23+
9.配置多个高可用服务注册中心时,一直报错:
24+
Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode <br>

0 commit comments

Comments
 (0)