Eureka-高可用
搭建俩个EurekaServer:eureka-server-1,eureka-server-2;然后相互注册,并取相同的应用名称
Server1
server:
port: 8761
eureka:
instance:
hostname: eureka-server-1
client:
service-url:
defaultZone: http://eureka-server-2:8762/eureka
spring:
application:
name: eureka-server-ha
Server2
server:
port: 8762
eureka:
instance:
hostname: eureka-server-2
client:
service-url:
defaultZone: http://eureka-server-1:8761/eureka
spring:
application:
name: eureka-server-ha
Client调用
eureka:
instance:
hostname: localhost
client:
service-url:
defaultZone: http://eureka-server-1:8761/eureka,http://eureka-server-2:8762/eureka