Data maintenance for a consistent hash server

Source: Internet
Author: User

This article is an example of a consistent hash server for data maintenance purposes. Theoretical note reference: http://blog.csdn.net/chenjiayi_yun/article/details/41624603

As shown in this example, the consistent hash server group is a group of video servers, including three types of servers: Vchannelmediaserver, Vchannelserver, Vchannelloadserver, Vchannelsuperserver.


Vchannelmediaserver Channel Dynamic Data (member data) and access server, save channel member information, provide access address to the client (similar to the gateway), the request sent to Vchannelserver is based on the consistency of the channel ID hash decision.

The Vchannelserver channel data server, which saves the specific information of the channel, provides an interface for manipulating the channel objects, and each channel object exists in the server in a consistent hash form.

Vchannelloadserver is a channel load server that keeps a list of all channels, maintains the server consistency hash table within the Vchannelmediaserver and Vchannelserver servers, Maintains channel object loading and removal in the vchannelserver.

Vchannelloadserver are single-server, Vchannelserver and vchannelmediaserver are dynamic-boot multi-server.

Vchannelsuperserver Direct-to-air superior server that provides an up-to-the-connection interface to all related servers in the live broadcast.


Data maintenance includes: Dynamic boot Vchannelserver server needs to dynamically load and remove server data, dynamic shutdown Vchannelserver Server needs to restore the server's channel to other servers, new data needs to be loaded and backed up.

(1) Loading data

When a vchannelserver is started, a Vchannelloadserver synchronization server hash Consistency list is required, and the list is the channel of the server, and the data from those channels is loaded from the database to this process. Vchannelloadserver, based on a hash table, calculates some of the channels that belong to the new startup Vchannelserver, sending instructions to other vchannelserver to remove data belonging to those channels in the process.

(2) Downtime recovery data

When a vchannelserver is down, it needs to reload the channel data to another server, and Vchannelloadserver periodically checks the connection of the outage server in the Vchannelserver connection. Assign a new server to each channel of the original outage server according to the Server hash table (will be added to the waiting Allocation list, and then allocated when there is a suitable server)

(3) New data

When a channel is created, the specified vchannelserver loads the channel's data, backs up the channel ID to vchannelloadserver, updates its server hash consistency list, and updates the Vchannelserver payload.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Data maintenance for a consistent hash server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.