This application relates to the field of data communication technology, in particular to an election control method and device, an election method and device, which are applied to nodes deployed with a target monitoring process monitor in a cluster service system. The method includes: monitoring the running environment of the first node deployed with the first monitor; and monitoring the running ring when it is deployed When there are exceptions in the environment, the first monitor is closed to prevent the first monitor from participating in leader lead elections in multiple monitors and providing services to clients outside the cluster. In this way, when the monitor's running state and running environment are abnormal, it will not repeatedly enter the election state, and will not cause the interruption of the whole cluster services. In addition, it will not provide services to the client in the problematic state, thus saving system resources and increasing the number of distributed storage clusters. Reliability.
【技术实现步骤摘要】
选举控制方法及装置
本申请涉及数据通信
,尤其涉及一种选举控制方法及装置。
技术介绍
Ceph是一种为优秀的性能、可靠性和可扩展性而设计的统一的、分布式文件系统。在Ceph中,为了避免单端故障,通常由若干个监控进程(monitor)共同负责管理、维护和发布集群的状态信息;在若干个monitor中会选出一个领导者(leader),这些monitor中的其它普通参与选举成员(peon)在该leader的领导下,生成集群图(clustermap)的最新版本,然后将该最新版本发送至Ceph中的全体对象存储设备(Object-basedStorageDevice,OSD)以及客户端(Client)。OSD使用clustermap进行数据的维护,而Client使用clustermap进行数据的寻址。在进行leader选举时,先由有选举资格的monitor共同形成一个委员会(quorum),然后委员会的成员在内部选出leader。每个monitor在初始化的时候都会被赋予一个排位(rank)值,当选举leader时,rank值最小的monitor胜出当选leader。每个monitor在启动并完成初始化后会向其它monitor发送探测报文,若根据回应报文中的quorum信息,确定已形成有quorum,则作为quorum的一员发起选举。这里,形成quorum的条件是可参与选举的monitor数量超过全部monitor数量的一半。某monitor当选为leader的条件为同意其成为leader的monitor数量超过全部monitor数量的一半。在leader选举期间 ...
【技术保护点】
1.一种选举控制方法,其特征在于,该方法应用于集群服务系统中部署有第一监控进程monitor的第一节点,该方法包括:监测所述部署有第一monitor的第一节点的运行环境;当监测到所述运行环境中存在异常情况后,将所述第一monitor关闭,以阻止所述第一monitor在多个monitor中参与领导者leader选举及向集群外客户端提供服务。
【技术特征摘要】
1.一种选举控制方法,其特征在于,该方法应用于集群服务系统中部署有第一监控进程monitor的第一节点,该方法包括:监测所述部署有第一monitor的第一节点的运行环境;当监测到所述运行环境中存在异常情况后,将所述第一monitor关闭,以阻止所述第一monitor在多个monitor中参与领导者leader选举及向集群外客户端提供服务。2.根据权利要求1所述的方法,其特征在于,所述集群服务系统中包含多个monitor和多个对象存储设备OSD;其中,所述多个monitor中的leader根据各个monitor分别管理的数据存储信息,生成集群图clustermap,所述clustermap中包含有OSD中数据的存储位置信息,所述集群外客户端使用clustermap进行数据的寻址。3.根据权利要求1所述的方法,其特征在于,所述监测所述部署有第一monitor的第一节点的运行环境,具体包括:监测所述部署有第一monitor的第一节点与集群内部署有其它monitor的节点之间的链路状态,以及监测所述第一节点的网卡状态。4.根据权利要求3所述的方法,其特征在于,监测所述部署有第一monitor的第一节点与集群内部署有其它monitor的节点之间的链路状态,包括:监测所述第一节点与集群内部署有其它monitor的节点之间的心跳连接是否超时;其中,心跳连接超时是指当发起心跳包后,在预设时长内未收到反馈的心跳包;若根据监测结果,确定与所述第一节点之间的心跳连接超时的节点的数量达到预设数量、且与任一节点之间心跳连接连续超时的次数达到预设次数,则认为所述链路状态存在异常。5.根据权利要求3所述的方法,其特征在于,所述监测所述部署有第一monitor的第一节点的网卡状态,包括:周期性统计所述部署有第一monitor的第一节点中网卡的丢包率;若所述部署有第一monitor的第一节点的网卡的丢包率超出预设的丢包率阈值,则确定所述网卡状态存在异常。6.根据权利要求5所述的方法,其特征在于,所述第一节点中设置有主网卡和备用网卡;若所述部署有第一monitor的第一节点的网卡的丢包率超出预设的丢包率阈值,则确定所述网卡状态存在异常,包括:周期性统计所述主网卡的丢包率;若所述主网卡的丢包率超出预设的丢包率阈值,则确定所述主网卡存在异常,在所述主网卡停用,启用备用网卡后,周期性统计所述备用网卡的丢包...
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。