The embodiment of the invention provides a Zookeeper cluster system and its connection method and device, including a proxy device, which is deployed on the machine on which the Zookeeper client is located, each Zookeeper client is connected to the server through the proxy device, wherein the proxy device is used to maintain the service end sequence of the Zookeeper cluster. Table, and according to the request of the Zookeeper client, connect the Zookeeper client to the server specific machine, and forward the request of the Zookeeper client to the specific machine. Because the proxy device is deployed on the machine on which the Zookeeper client is located and the server list is maintained, the Zookeeper client can retrieve the server list in close proximity to update its own server list. Since the server list is not retrieved from the server to update, the resource contention problem is avoided Thus, it can avoid the problem of not updating the server list in time because of resource competition.
【技术实现步骤摘要】
一种Zookeeper集群系统及其连接方法和装置
本专利技术涉及互联网
,特别是涉及一种Zookeeper集群系统及其连接方法和装置。
技术介绍
Zookeeper集群是被很多互联网公司广泛使用的分布式协调系统,其作为分布式系统的重要基石,所提供的协调机制被很多重要的大型分布式系统底层所依赖,比如分布式计算系统Hadoop,消息系统Kafka等。Zookeeper集群依赖Zab协议为用户提供了一致性的保证,可提供选主、分布式锁等功能。由于Zookeeper集群的底层依赖ZAB协议,所以客户端的写操作需要在大多数服务端上同时写成功才被认为写成功,这种机制导致部署的服务端数目越多则写操作耗时越长。因此为了保证一致性和写操作的性能。在部署时一般选择3台或5台机器来部署Zookeeper集群。Zookeeper集群自身的限制使得需要Zookeeper客户端维护Zookeeper集群所有的服务端列表,并及时更新服务端列表。当大量客户端同时连接到Zookeeper集群的服务端时,由于资源竞争问题而导致客户端无法及时更新服务端列表。
技术实现思路
有鉴于此,本专利技术提供了一种Zookeeper集群系统及其连接方法和装置,以解决当大量客户端Zookeeper与服务端相连接时,因资源竞争而导致Zookeeper客户端无法及时更新服务端列表的问题。为了解决上述问题,本专利技术公开了一种Zookeeper集群系统,包括代理装置,所述代理装置部署在Zookeeper客户端所在的机器上,每个所述Zookeeper客户端通过所述代理装置与服务端相连接,其中:所述代理装置用于维护所 ...
【技术保护点】
1.一种Zookeeper集群系统,其特征在于,包括代理装置,所述代理装置部署在Zookeeper客户端所在的机器上,每个所述Zookeeper客户端通过所述代理装置与服务端相连接,其中:所述代理装置用于维护所述Zookeeper集群系统的服务端列表,并根据所述Zookeeper客户端的请求将所述Zookeeper客户端连接到所述服务端的所述请求所指向的具体机器上,并向所述具体机器转发所述Zookeeper客户端的请求。
【技术特征摘要】
1.一种Zookeeper集群系统,其特征在于,包括代理装置,所述代理装置部署在Zookeeper客户端所在的机器上,每个所述Zookeeper客户端通过所述代理装置与服务端相连接,其中:所述代理装置用于维护所述Zookeeper集群系统的服务端列表,并根据所述Zookeeper客户端的请求将所述Zookeeper客户端连接到所述服务端的所述请求所指向的具体机器上,并向所述具体机器转发所述Zookeeper客户端的请求。2.如权利要求1所述的Zookeeper集群系统,其特征在于,所述代理装置还用于当接收到所述Zookeeper客户端发送的列表更新指令时,将所维护的服务端类别返回给所述Zookeeper客户端。3.一种连接方法,应用于如权利要求1或2所述的Zookeeper集群系统的代理装置,其特征在于,所述代理装置包括至少一个处理器,以及与所述处理器相连接的存储器,所述存储器存储有可被所述处理器执行的指令,所述指令被所述处理器执行,以使所述处理器能够执行如下操作步骤:接收每个所述Zookeeper集群系统的Zookeeper客户端发送的请求指令;为所述请求指令配置路径信息;将配置有路径信息的请求指令发送到服务端;接收服务端根据附带有路径信息的...
【专利技术属性】
技术研发人员:梁云龙,
申请(专利权)人:北京奇艺世纪科技有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。