This commit is contained in:
YoVinchen 2023-08-15 15:59:19 +08:00
parent 64bf2b74db
commit d9bfd4e70b
6 changed files with 38 additions and 15 deletions

View File

@ -11,7 +11,7 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8888/eureka
defaultZone: http://localhost:8801/eureka, http://localhost:8802/eureka
instance:
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}

View File

@ -11,7 +11,7 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8888/eureka
defaultZone: http://localhost:8801/eureka, http://localhost:8802/eureka
instance:
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}

View File

@ -0,0 +1,18 @@
server:
port: 8801
spring:
application:
name: eurekaserver
eureka:
instance:
hostname: eureka01
prefer-ip-address: false
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client:
fetch-registry: true
register-with-eureka: false
serviceUrl:
defaultZone: http://eureka02:8802/eureka, http://eureka01:8801/eureka
server:
enable-self-preservation: false

View File

@ -0,0 +1,17 @@
server:
port: 8802
spring:
application:
name: eurekaserver
eureka:
instance:
hostname: eureka02
prefer-ip-address: false
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client:
fetch-registry: true
register-with-eureka: false
serviceUrl:
defaultZone: http://eureka01:8801/eureka, http://eureka02:8802/eureka
server:
enable-self-preservation: false

View File

@ -1,10 +0,0 @@
server:
port: 8888
eureka:
client:
fetch-registry: false
register-with-eureka: false
serviceUrl:
defaultZone: http://localhost:8888/eureka
server:
enable-self-preservation: false

View File

@ -1,5 +1,3 @@
server:
port: 8101
spring:
application:
name: userservice
@ -11,7 +9,7 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8888/eureka
defaultZone: http://localhost:8801/eureka, http://localhost:8802/eureka
instance:
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}