首页 > 编程知识 正文

eureka集群同步策略,docker eureka集群

时间:2023-05-06 11:24:25 阅读:128767 作者:3321

一、新建springboot项目

要添加依存关系,请执行以下操作:

ependenciesdependencygroupidorg.spring框架. cloud/groupidartifactidspring-cloud-starter-Netflix-eureka-seecureka-ependencydependencygroupidorg.spring framework.bb

#版权所有(c ) 1993-2009 Microsoft corp.# # thisisasamplehostsfileusedbymicrosofttcp/IP for windows.# # thisfilecontainsthemappingsofipaddressestohostnames.each # entryshouldbekeptonanindividualline.theipaddresssshould # beplacedinthefirstcolumnfollowedbythecorrespondinghostname.# theipaddressandthehostnameshouldbeseparatedbyatleastone # space comments(suchasthese ) maybeinsertedonindividual # linesorfollowingthemachinenamedenotedbya ' # ' symbol.# # for example 333333 sourceserver # 38.25.63.10 x.acme.com # xclienthost # localhostnameresolutionion 127.0.0.1 localhost # 3:33366

1.APP.yml

spring : profiles 3360 active : eureka1application : name : eureka-demo2. application-eureka1. yml

server : port :8001 eureka : client : register-with-eureka : true #在Eureka Server上注册了此实例, 指示其他实例是否可以发现Fetch-Registry3360客户端从Eureka Server获取实例注册信息service-URL : default zone :3358 eureka2.com 3360

server : port :8002 eureka : client : register-with-eureka : true #表示此实例已在Eureka Server上注册, 指示其他实例是否可以发现Fetch-Registry3360客户端从Eureka Server获取实例注册信息service-URL : default zone :3358 eureka1.com 3360

修改application.yml文件的active属性,分别更改为eureka1和eureka2,然后启动群集。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。