1. 程式人生 > >【Zookeeper】——Why should we use zookeeper?

【Zookeeper】——Why should we use zookeeper?

Table of content

When we learn something ,we should ask ourselves some questions,such as what is it ? why should we use it ?how to use it? when to use it and where to use it ?

Now,in this article we have three questions:

The first —— why should we use Services Discovery?

The second ——why do we choose zookeeper to do this kind of things?

The third ——what are the challenges o discovery services?

So,it’s time to give the answers!

why should we use Services Discovery

In our old ITOO project(a distributed system), if we want to invoke other services ,we should now what is the service’s name ,where is it ? we should know the exactly position of the service,you should know the service’s url then use the JNDI technology to find it.You know in this way,if we change the service’s url,we should change every services that invoke this service,it’s difficult to maintence.So we should use a concentrated position to manage all services,make it easy to pulish and discovery.

why do we choose zookeeper to do this kind of things?

You know there are many services discovery service,which should I choose? The services that we can use are DNS,Zookeeper,etcd,doorerd ,Consul,Eureka and forth on !

Oh, my God,there are so many,what is the right one to our project?maybe we should check each of that services and compare the differents to find the most suitable one.

As mentioned DNS has been used for a long time and is probably the largest Service Discovery system out there. For small-scale setups start with DNS but once you start provisioning nodes more dynamically, DNS starts becoming problematic due to the propagation time.

Arguably, Zookeeper is the most mature of the config stores used for discovery since it has been around for quite some time and is a comprehensive solution including configuration management, leader election, distributed locking etc. This makes it a very compelling general-purpose solution although it’s often more complex than it could be.

etcd & doozerd are the new age cousins of Zookeeper, built with similar architectures and features sets and hence can be used interchangeably in place of Zookeeper

Consul is a newer solution in this space that provides configuration management and a generic key-value store apart from Service Discovery. It also has killer features of health checking of nodes and supporting DNS SRV for improved interop with other systems. A big differentiator from Zookeeper is the HTTP & DNS APIs that can be used to interact with consul vis-à-vis a Zookeeper client.

If you lean more towards AP systems Eureka is a great choice and is battle tested in Netflix and it prefers Availability over Consistency in the wake of network partitions.

So,maybe zookeeper is the most suitable one for our project.

what are the challenges o discovery services?

It’s more complicated than you realize: it’s an extension of the distributed systems problem.

You might roll out configuration files with service names, IPs and ports but when the system becomes very dynamic you need to migrate to a “real” Service Discovery solution and that migration is usually not as easy as you think. One of the biggest challenges is the inability to understand how intrusive the choice of a Service Discovery system is: once chosen it is very difficult to change it and hence it is critical to do it right.

Most systems implement some form of distributed consensus algorithms, designed to be resilient in the face of node outages, but these algorithms are notoriously hard to get right and understanding failure modes is both key and difficult and failing to analyse them correctly usually takes you to make the wrong choices.

All the questions are answered,here is my summary about the Services Discovery

這裡寫圖片描述

Summary

In this article,some ideas come from other people,some of come from mine,but it doesn’t matter,just do it,then do it better!

相關推薦

Zookeeper——Why should we use zookeeper?

Table of content When we learn something ,we should ask ourselves some questions,such as what is it ? why should we use it ?how

Kafka使用非自帶zookeeper Java API 例子

這裡沒有使用kafka自帶的zk。1.啟動zk:zk下載解壓至任意資料夾。新建kafka-zk-csdn資料夾。這裡啟動包含三個節點的zk偽叢集,進入kafka-zk-csdn資料夾,新建zk1,zk2和zk3資料夾。kafka-zk-csdn:--zk1    --data

視頻筆記 CppCon 2015:Marshall Clow “Type Traits - what are they and why should I use them?"

for -- per 是的 point 分類 ace ner null Video: CppCon 2015:Marshall Clow “Type Traits - what are they and why should I use them?" https://www

Why containers? Why should we care?

ica mage sign share kernel install vid sep names https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/ The Old

[Angular] Why should we using Protal

https access lac spa dset containe ant rds contact Origianl article Protal from Angular CDK, is a way to create dynammic component.

Ask HN: Should we use website log analyzers again?

As I'm thinking about privacy on my own blog I'm wondering, "should we use log file analyzers again?" My primary motivation is not sharing my users informa

NASA's Insight Mission: When will it land and why should we care?

NASA's six-month expedition to reach Mars to study its interior will take seven minutes to land on Monday at 20:00 GMT. InSight Lander - the Interior Explo

JmeterAddress already in use : connect &&Permission denied: connect 解決方案

in use 重啟 基數 nec key res gedit pip 解決方案 Address already in use : connect 該問題的原因為:     Windows 提供給 TCP/IP鏈接的端口為 1024-5000,並且要四分鐘來循環回收他

推薦微服務分布式企業框架 Springmvc+mybatis+shiro+Dubbo+ZooKeeper+Redis+KafKa

分布式、微服務、雲架構 Spring SpringMVC Spring MVC+Mybatis Dubbo+Zookeeper Redis分布式緩存 FastDFS ActiveMQ 平臺簡介 Jeesz是一個分布式的框架,提供項目模塊化、服務

分布式協調zookeeper利用ansible部署篇

zookeeper一、環境準備操作系統:centOS-6.8 2.6.32-642.el6.x86_64【虛擬機環境】 節點主機:10.0.55.3、10.0.55.5、10.0.55.6 目錄結構: /opt/ 軟件版本: jdk-7u67-linux-x64.rpm zooke

分布式協調zookeeper基礎篇

zookeeper 原理 架構模型一、zookeeper介紹 它是一個為分布式應用提供一致性服務的軟件,提供的功能包括:配置維護、名字服務、分布式同步、組服務等zookeeper做了什麽?1.命名服務 2.配置管理 3.集群管理 4.分布式鎖 5.隊列管理二、zookeeper架構的架構模型zookeeper

分布式協調zookeeper安裝篇

zookeeper 部署一、環境準備操作系統:centOS-6.8 2.6.32-642.el6.x86_64【虛擬機環境】 節點主機:10.0.55.3、10.0.55.5、10.0.55.6 目錄結構: /opt/ 軟件版本: jdk-7u67-linux-x64.rpm zo

淺談分布式服務協調技術 Zookeeper

客戶 內存數據 訂閱 數據開發 watcher database 所有 ren info 非常好介紹Zookeeper的文章, Google的三篇論文影響了很多很多人,也影響了很多很多系統。這三篇論文一直是分布式領域傳閱的經典。根據MapReduce,於是

《從Paxos到Zookeeper:分布式一致性原理與實踐》PDF下載

如何 目錄 可用 思路 服務器 技巧 計算機 讀者 演變 內容簡介 Paxos到Zookeeper分布式一致性原理與實踐從分布式一致性的理論出發,向讀者簡要介紹幾種典型的分布式一致性協議,以及解決分布式一致性問題的思路,其中重點講解了Paxos和ZAB協議。同時,本書深入

zookeeper簡單安裝

zookeeper1.安裝java#!/bin/bash # rpm -ivh jdk-8u144-linux-x64.rpm # java -version java version "1.8.0_144"2.安裝zookeeper下載地址 : http://zookeeper.apac

zookeeper集群安裝

zookeeper cluster zoo.cfg 1.解壓(按照簡單安裝操作)2.修改配置文件vim zoo.cfg ----------- # The number of milliseconds of each tick tickTime=2000 # The number of ticks

Zookeeper學習---zookeeper 選舉機制介紹

erp change 交換 內容 數值 所有 ase 一輪 eval 【原文】https://www.toutiao.com/i6593162565872779784/ zookeeper集群 配置多個實例共同構成一個集群對外提供服務以達到水平擴展的目的,每個服務器上的數據

zookeeperApache curator的使用及zk分布式鎖實現

sets finally tac -- ont zkcli 單節點 基本操作 新建 上篇,本篇主要講Apache開源的curator的使用,有了curator,利用Java對zookeeper的操作變得極度便捷. 其實在學之前我也有個疑慮,我為啥要學curator,撇開漲薪

zookeeperzookeeper的基本命令及通過Java操作zk

接上講,這節主要講一下zookeeper的常用命令和如何使用java操作zk. 首先連線zookeeper 客戶端: #進入zookeeper安裝目錄下bin目錄,啟動zk客戶端 cd /usr/local/zookeeper/bin ./zkCli.sh 然後不知道zk的常用命令?沒

zookeeperApache curator的使用及zk分散式鎖實現

接上篇,本篇主要講Apache開源的curator的使用,有了curator,利用Java對zookeeper的操作變得極度便捷. 其實在學之前我也有個疑慮,我為啥要學curator,撇開漲薪這些外在的東西,就單技術層面來講,學curator能幫我做些什麼?這就不得不從zookeeper說起,上