ZooKeeper在Dubbo應(yīng)用

dubbo目錄下所有服務(wù)
[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]
服務(wù)節(jié)點
[zk: localhost:2181(CONNECTED) 6] ls /dubbo/uyun.spider.resource.api.LinkService
[consumers, configurators, routers, providers]
服務(wù)提供者
  • 在服務(wù)提供者初始化時揩瞪,dubbo首先會在ZooKeeper的/dubbo/uyun.spider.resource.api.LinkService/providers節(jié)點下創(chuàng)建一個子節(jié)點,并寫入自己的URL地址载荔,代表了LinkService服務(wù)的一個提供者
[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]
服務(wù)消費者
  • 服務(wù)消費者啟動時擎鸠,讀取并且訂閱ZooKeeper上/dubbo/uyun.spider.resource.api.LinkService/providers下面的所有子節(jié)點召耘,同時谢谦,服務(wù)消費者還會在ZooKeeper的uyun.spider.resource.api.LinkService/consumers節(jié)點下創(chuàng)建一個臨時節(jié)點,并寫入自己的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的監(jiān)控中心是dubbo服務(wù)治理體系的重要一部分髓削,它會通過ZooKeeper的相關(guān)service節(jié)點來獲取所有消費者生產(chǎn)者的URL地址,并且注冊Watcher來監(jiān)聽其子節(jié)點的變化镀娶。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末立膛,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子梯码,更是在濱河造成了極大的恐慌宝泵,老刑警劉巖,帶你破解...
    沈念sama閱讀 210,914評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件轩娶,死亡現(xiàn)場離奇詭異儿奶,居然都是意外死亡,警方通過查閱死者的電腦和手機鳄抒,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 89,935評論 2 383
  • 文/潘曉璐 我一進店門闯捎,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人许溅,你說我怎么就攤上這事瓤鼻。” “怎么了贤重?”我有些...
    開封第一講書人閱讀 156,531評論 0 345
  • 文/不壞的土叔 我叫張陵茬祷,是天一觀的道長。 經(jīng)常有香客問我游桩,道長牲迫,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,309評論 1 282
  • 正文 為了忘掉前任借卧,我火速辦了婚禮盹憎,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘铐刘。我一直安慰自己陪每,他們只是感情好,可當我...
    茶點故事閱讀 65,381評論 5 384
  • 文/花漫 我一把揭開白布镰吵。 她就那樣靜靜地躺著檩禾,像睡著了一般。 火紅的嫁衣襯著肌膚如雪疤祭。 梳的紋絲不亂的頭發(fā)上盼产,一...
    開封第一講書人閱讀 49,730評論 1 289
  • 那天,我揣著相機與錄音勺馆,去河邊找鬼戏售。 笑死侨核,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的灌灾。 我是一名探鬼主播搓译,決...
    沈念sama閱讀 38,882評論 3 404
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼锋喜!你這毒婦竟也來了些己?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,643評論 0 266
  • 序言:老撾萬榮一對情侶失蹤嘿般,失蹤者是張志新(化名)和其女友劉穎段标,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體博个,經(jīng)...
    沈念sama閱讀 44,095評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡怀樟,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,448評論 2 325
  • 正文 我和宋清朗相戀三年功偿,在試婚紗的時候發(fā)現(xiàn)自己被綠了盆佣。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,566評論 1 339
  • 序言:一個原本活蹦亂跳的男人離奇死亡械荷,死狀恐怖共耍,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情吨瞎,我是刑警寧澤痹兜,帶...
    沈念sama閱讀 34,253評論 4 328
  • 正文 年R本政府宣布,位于F島的核電站颤诀,受9級特大地震影響字旭,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜崖叫,卻給世界環(huán)境...
    茶點故事閱讀 39,829評論 3 312
  • 文/蒙蒙 一遗淳、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧心傀,春花似錦屈暗、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,715評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至宰翅,卻和暖如春弃甥,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背汁讼。 一陣腳步聲響...
    開封第一講書人閱讀 31,945評論 1 264
  • 我被黑心中介騙來泰國打工淆攻, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留肮之,地道東北人。 一個月前我還...
    沈念sama閱讀 46,248評論 2 360
  • 正文 我出身青樓卜录,卻偏偏與公主長得像戈擒,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子艰毒,可洞房花燭夜當晚...
    茶點故事閱讀 43,440評論 2 348

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理筐高,服務(wù)發(fā)現(xiàn),斷路器丑瞧,智...
    卡卡羅2017閱讀 134,626評論 18 139
  • 客戶端 znode 可能含有數(shù)據(jù)柑土,也可能沒有。如果 znode 包含數(shù)據(jù)绊汹,那么數(shù)據(jù)存儲為字節(jié)數(shù)組(byte arr...
    PFF閱讀 1,093評論 0 1
  • ZooKeeper是Hadoop Ecosystem中非常重要的組件稽屏,它的主要功能是為分布式系統(tǒng)提供一致性協(xié)調(diào)(C...
    把愛放下會走更遠閱讀 21,689評論 1 18
  • 本文主要從應(yīng)用的角度對ZooKeeper做了淺析,試圖闡明ZooKeeper是什么西乖、主要應(yīng)用場景有哪些狐榔、常用場景可...
    菜鳥小玄閱讀 3,415評論 0 6
  • 從根本上薄腻,最高抽象上即信念認知的層面回答:世界是怎樣的?人如何存在届案?人類將走向何方庵楷? 從精神層面,給人以信仰楣颠、理想...
    李洪建閱讀 1,309評論 0 1