ZooKeeper在Dubbo应用

dubbo目录下所有服务
[zk: localhost:2181(CONNECTED) 2] ls /dubbo
[uyun.bird.tenant.api.UserAuditService, uyun.spider.event.api.service.EventService, uyun.pacific.resource.api.service.ResKeyIdentifierService, uyun.spider.resource.api.HostStatusService, uyun.eagle.web.api.service.DataRestService, uyun.pacific.model.api.service.ResUniqueKeyService, uyun.eagle.web.api.service.AlertRestService, uyun.spider.topo.api.LabelService, uyun.spider.topo.rest.TopoStatusService, uyun.spider.agent.mgr.api.TaskManagerService, uyun.indian.model.api.ResourceService, uyun.spider.topo.api.NodeDisplayService, uyun.crab.repo.api.CIChangeStatisticService, uyun.crab.circle.api.ViewService, uyun.eagle.web.api.service.ApplyRuleRestService, uyun.spider.resource.api.ProtocolService, uyun.crab.model.api.service.ResClassIconService, uyun.bird.tenant.api.HealthCheckService, uyun.crab.model.api.service.CategoryService, uyun.crab.circle.api.SubscribeService, uyun.innerdatademo.rest.service.RestService, uyun.eagle.web.api.service.TreeMapRestService, uyun.bering.api.service.TagService, uyun.pacific.model.api.service.ResRelationMetaService, uyun.bird.tenant.service.UserImagesService, uyun.spider.agent.mgr.api.AgentManagerService, uyun.eagle.datacenter.api.service.RuleService, uyun.arctic.checkpoint.api.WriterService, uyun.eagle.datacenter.api.service.ApplicationService, uyun.spider.resource.api.HostGroupService, uyun.eagle.gateway.api.service.WebHookApi, uyun.eagle.gateway.api.service.HealthCheckFrontService, uyun.eagle.web.api.service.CommonRestService, uyun.indian.reader.api.ReaderService, uyun.eagle.datacenter.api.service.IncidentListService, uyun.crab.model.api.service.AuthorityService, uyun.pacific.resource.api.service.InlineObjectService, uyun.spider.resource.api.ProducerService, uyun.eagle.datacenter.api.service.AlertService, uyun.spider.topo.api.TopoGroupService, uyun.eagle.datacenter.api.service.TagService, uyun.spider.topo.api.DictDataService, uyun.crab.circle.api.CommentService, uyun.eagle.web.api.service.VisualAnalyzeRestService, uyun.bird.tenant.service.RedisService, uyun.pacific.resource.api.service.ResourceHealthCheckService, uyun.spider.agent.mgr.api.TaskRelationService, uyun.crab.circle.api.ConsumpService, uyun.bird.tenant.service.InnerMqSendService, uyun.eagle.web.api.service.ApplicationTypeRestService, uyun.bird.tenant.api.TenantService, uyun.bird.notify.api.NotifyService, uyun.pacific.resource.api.service.ResObjectService, uyun.bird.tenant.service.OnlineUserService, uyun.eagle.datacenter.api.service.TreeMapService, uyun.eagle.web.api.service.ActionRestService, uyun.bird.tenant.api.UserService, uyun.bird.tenant.api.UserExcessService, uyun.bird.tenant.service.CasHtmlService, uyun.bird.tenant.api.TagService, uyun.hornet.service.api.service.TicketStatisticService, uyun.indian.writer.api.WriterService, uyun.bird.notify.api.HealthCheckService, uyun.bird.tenant.service.LockUserService, uyun.bird.tenant.service.CodeService, uyun.eagle.datacenter.api.service.ApplyRuleService, uyun.spider.datastore.api.service.ResourceService, uyun.bird.tenant.api.CompanySizeService, uyun.pacific.model.api.service.ModelService, uyun.spider.resource.rest.ResourceStatusService, uyun.bird.tenant.service.Base64CodeService, uyun.eagle.datacenter.api.service.ActionConfigService, uyun.pacific.model.api.service.ModelHealthCheckService, uyun.eagle.web.api.service.IncidentRestService, uyun.bird.tenant.service.IComptrollerLogService, uyun.bird.tenant.service.LincenseService, uyun.crab.model.api.service.CIFormService, uyun.bird.tenant.api.SmsValidateService, uyun.spider.resource.api.TagService, uyun.spider.resource.api.StoreService, uyun.crab.circle.api.CircleService, uyun.eagle.datacenter.api.rest.service.HealthCheckFrontService, uyun.crab.repo.api.SandboxService, uyun.eagle.datacenter.api.service.ResObjectStateService, uyun.eagle.gateway.api.service.RuleRestService, uyun.bird.tenant.service.DepartUserService, uyun.spider.resource.api.HostModelService, uyun.spider.agent.mgr.service.AgentService, uyun.spider.resource.api.LinkService, uyun.spider.topo.api.CollectPointService, uyun.bird.tenant.service.TenantSecurityPolicyService, uyun.eagle.gateway.api.service.TagServiceApiService, uyun.crab.circle.api.AutoClaimPolicyService, uyun.innerdatastore.rest.service.RestService, uyun.bird.tenant.service.ConfigurationService, uyun.indian.model.api.MetricService, uyun.eagle.web.api.service.ApplicationRestService, uyun.bird.tenant.service.ExcelService, uyun.bird.tenant.service.BatchUserService, uyun.eagle.web.api.service.RuleRestService, uyun.eagle.datacenter.api.service.ApplicationTypeService, uyun.bird.tenant.api.TimezoneLangService, uyun.eagle.gateway.api.service.IncidentOpenApiService, uyun.bird.tenant.api.ProductService, uyun.bird.tenant.api.IDepartService, uyun.crab.circle.api.ChartService, uyun.eagle.datacenter.api.service.IncidentLogService, uyun.spider.monitor.api.service.MonitorService, uyun.eagle.gateway.api.service.IncidentServiceApiService, uyun.ant.manager.agent.logic.AgentOperator, uyun.innerdatazabbix.rest.service.RestService, uyun.spider.event.rest.EventStatusService, uyun.spider.topo.api.TopoService, uyun.arctic.model.api.StateService, uyun.bird.tenant.service.DepartService, uyun.pacific.model.api.service.ResAttributeService, uyun.pacific.resource.api.service.ResHistoryService, uyun.pacific.model.api.service.ResClassService, uyun.eagle.datacenter.api.service.IncidentService, uyun.pacific.model.api.service.ResInterfaceService, uyun.spider.resource.api.HostService, uyun.bird.tenant.api.ComptrollerLogService, uyun.crab.repo.api.SearchService, uyun.spider.topo.api.NodeService, uyun.bird.tenant.api.IndustryService, uyun.crab.repo.api.CIStatisticService, uyun.crab.repo.api.BaselineService, uyun.crab.repo.api.CICircleStatisticService, uyun.spider.agent.mgr.event.AgentManager, uyun.pacific.model.api.service.InlineClassService, uyun.spider.datastore.api.service.MetricService, uyun.spider.resource.api.InterfaceService, uyun.pacific.model.api.service.ResRelationTypeService, uyun.pacific.resource.api.service.ResTagService, uyun.pacific.resource.api.service.AuditService, uyun.spider.agent.mgr.api.UnsupportedHostService, uyun.spider.monitor.rest.MonitorStatusService, uyun.eagle.datacenter.api.service.ActionService, uyun.bird.notify.api.imsg.IMessageService, uyun.arctic.checkpoint.api.ReaderService, uyun.bee.lm.api.LM, uyun.spider.agent.mgr.service.TaskService, uyun.eagle.web.api.service.HealthCheckFrontService, uyun.pacific.resource.api.service.NetworkZoneService, uyun.bird.tenant.api.LogService, uyun.pacific.resource.api.service.ResRelationService, uyun.crab.circle.api.GroupService, uyun.eagle.datacenter.api.service.CommonService, uyun.spider.topo.api.TopoCategoryService, uyun.spider.agent.mgr.event.TaskManager, uyun.spider.agent.mgr.rest.AgentStatusService, uyun.eagle.gateway.api.service.FlumeService, uyun.spider.resource.api.MetricService, uyun.crab.repo.api.CIRecordService]
服务节点
[zk: localhost:2181(CONNECTED) 6] ls /dubbo/uyun.spider.resource.api.LinkService
[consumers, configurators, routers, providers]
服务提供者
  • 在服务提供者初始化时,dubbo首先会在ZooKeeper的/dubbo/uyun.spider.resource.api.LinkService/providers节点下创建一个子节点,并写入自己的URL地址,代表了LinkService服务的一个提供者
[zk: localhost:2181(CONNECTED) 7] ls /dubbo/uyun.spider.resource.api.LinkService/providers
[dubbo%3A%2F%2F10.1.50.64%3A7900%2Fuyun.spider.resource.api.LinkService%3Fanyhost%3Dtrue%26application%3Dspider-server-resource%26default.retries%3D0%26default.service.filter%3Di18nProviderFilter%26default.timeout%3D30000%26dubbo%3D2.8.4.170831%26generic%3Dfalse%26interface%3Duyun.spider.resource.api.LinkService%26methods%3DdeleteByHostId%2Cget%2Cquery%2Cupdate%2Ccreate%2CgetInterfacePeer%2Cdelete%2CfindAll%2CdeleteByIfId%26pid%3D31375%26revision%3Dapi%26serialization%3Dkryo%26service.filter%3Di18nProviderFilter%2Cerror-logger%26side%3Dprovider%26timestamp%3D1511255592038]
服务消费者
  • 服务消费者启动时,读取并且订阅ZooKeeper上/dubbo/uyun.spider.resource.api.LinkService/providers下面的所有子节点,同时,服务消费者还会在ZooKeeper的uyun.spider.resource.api.LinkService/consumers节点下创建一个临时节点,并写入自己的URL地址
[zk: localhost:2181(CONNECTED) 10] ls /dubbo/uyun.spider.resource.api.LinkService/consumers    
[consumer%3A%2F%2F10.1.50.64%2Fuyun.spider.resource.api.LinkService%3Fapplication%3Dspider-gateway%26category%3Dconsumers%26check%3Dfalse%26default.reference.filter%3Di18nConsumerFilter%26default.retries%3D0%26default.timeout%3D6000%26dubbo%3D2.8.4.170831%26interface%3Duyun.spider.resource.api.LinkService%26methods%3DdeleteByHostId%2Cget%2Cquery%2Cupdate%2Ccreate%2CgetInterfacePeer%2Cdelete%2CfindAll%2CdeleteByIfId%26pid%3D31955%26retries%3D0%26revision%3Dapi%26side%3Dconsumer%26timestamp%3D1511255599128, consumer%3A%2F%2F10.1.50.64%2Fuyun.spider.resource.api.LinkService%3Fapplication%3Dspider-server-topo%26category%3Dconsumers%26check%3Dfalse%26default.reference.filter%3Di18nConsumerFilter%26default.retries%3D0%26default.timeout%3D10000%26dubbo%3D2.8.4.170831%26interface%3Duyun.spider.resource.api.LinkService%26methods%3DdeleteByHostId%2Cget%2Cquery%2Cupdate%2Ccreate%2CgetInterfacePeer%2CfindAll%2Cdelete%2CdeleteByIfId%26pid%3D31466%26retries%3D0%26revision%3Dapi%26side%3Dconsumer%26timeout%3D10000%26timestamp%3D1511255577683]
dubbo的监控中心是dubbo服务治理体系的重要一部分,它会通过ZooKeeper的相关service节点来获取所有消费者生产者的URL地址,并且注册Watcher来监听其子节点的变化。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,080评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,422评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,630评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,554评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,662评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,856评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,014评论 3 408
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,752评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,212评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,541评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,687评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,347评论 4 331
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,973评论 3 315
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,777评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,006评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,406评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,576评论 2 349

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,633评论 18 139
  • 客户端 znode 可能含有数据,也可能没有。如果 znode 包含数据,那么数据存储为字节数组(byte arr...
    PFF阅读 1,093评论 0 1
  • ZooKeeper是Hadoop Ecosystem中非常重要的组件,它的主要功能是为分布式系统提供一致性协调(C...
    把爱放下会走更远阅读 21,700评论 1 18
  • 本文主要从应用的角度对ZooKeeper做了浅析,试图阐明ZooKeeper是什么、主要应用场景有哪些、常用场景可...
    菜鸟小玄阅读 3,416评论 0 6
  • 从根本上,最高抽象上即信念认知的层面回答:世界是怎样的?人如何存在?人类将走向何方? 从精神层面,给人以信仰、理想...
    李洪建阅读 1,309评论 0 1