譬如eureka.client.register-with-eureka和fetch-registry是否要配置,配不配區別在哪裏;eureka的客戶端添加service-url時,是否是須要把全部的eureka的server地址都寫上,仍是隻須要寫一個server就能夠了(由於server之間已經相互註冊了)?若是寫上了全部的server地址,那至關於將每一個client服務都往全部的server都添加了一遍,那還配置server間的相互註冊有什麼意義?spring
server: port: 20001 eureka: instance: hostname: server1 client: # 表示是否註冊自身到eureka服務器 # register-with-eureka: false # 是否從eureka上獲取註冊信息 # fetch-registry: false service-url: defaultZone: http://server2:20002/eureka/
server: port: 20002 eureka: instance: hostname: server2 client: #register-with-eureka: false #fetch-registry: false service-url: defaultZone: http://server1:20001/eureka/
spring: application: name: eureka_client eureka: client: service-url: defaultZone: http://server1:20001/eureka/