-
Notifications
You must be signed in to change notification settings - Fork 1
01 eureka register
Alan edited this page Mar 20, 2018
·
9 revisions
application-registry1.properties application-registry2.properties
-
两个不同的配置文件分别使用1001和1002对外提供注册服务
server.port=1001
server.port=1002 -
默认使用hostname进行对外发布,在开发机上很容易先无法注册,所以建议将其设置为使用ip.
eureka.instance.prefer-ip-address=true -
两个配置中心节点为了保证高可用,所以采用相互注册的形式,1001的节点将服务注册到1002,1002的节点将服务注册到1001,这一点请注意!
eureka.client.serviceUrl.defaultZone=http://127.0.0.1:1002/eureka/
eureka.client.serviceUrl.defaultZone=http://127.0.0.1:1002/eureka/