3.spring cloud eureka 高可用
1、目的 防止某一台服务器宕机 通常通过多台EUREKA来为客户端进行注册,客户也进行注册
2、开启三台EUREKA
三天EUREKA分别对应端口 8761 8762 8763
配置文件如下
EUREKA1
eureka:
client:
service-url:
defaultZone: http://localhost:8762/eureka,http://localhost:8763/eureka
register-with-eureka: false
server:
enable-self-preservation: false
spring:
application:
name: eureka
#server:
# port: 8761
management:
context-path: /
EUREKA2
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka,http://localhost:8763/eureka
register-with-eureka: false
server:
enable-self-preservation: false
spring:
application:
name: eureka
#server:
# port: 8761
management:
context-path: /
EUREKA3
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka,http://localhost:8762/eureka
register-with-eureka: false
server:
enable-self-preservation: false
spring:
application:
name: eureka
#server:
# port: 8761
management:
context-path: /
CLIENT
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/,http://localhost:8763/eureka/
spring:
application:
name: client
3.启动客户端和三台EUREKA
8761
8762
8763