Eureka集群
为了避免单点故障,Eureka注册中心会有集群,配置的时候只需要相互注册即可
例如三个服务器
一:
server: port: 8080 # 端口spring: application: name: eureka-server # 应用名称,会在Eureka中显示,集群时名称一致eureka: client: service-url: # 配置其他Eureka服务的地址,而不是自己,比如10087 defaultZone: http://127.0.0.1:8086/eureka,http://127.0.0.1:8088/eureka
二:
server: port: 8086 # 端口spring: application: name: eureka-server # 应用名称,会在Eureka中显示eureka: client: service-url: # 配置其他Eureka服务的地址,而不是自己,比如10087 defaultZone: http://127.0.0.1:8080/eureka,http://127.0.0.1:8088/eureka
三:
server: port: 8088 # 端口spring: application: name: eureka-server # 应用名称,会在Eureka中显示eureka: client: service-url: # 配置其他Eureka服务的地址,而不是自己,比如10087 defaultZone: http://127.0.0.1:8080/eureka,http://127.0.0.1:8086/eureka