memcached high availability cluster theory and introduction. memcached In the realization of distributed cluster deployment, the memcached service is not between the communication, the distributed algorithm is through the client bar Data stored in different memcached, so when we finish the cluster client to write data inside, Will appear the following situation.
After the client writes data to a memcached node, the other two nodes can not be queried.
So how the outcome of this issue, is the next to be done.
The fact that memcached can not communicate with one another over this type of cluster can not be tolerated in heavily visited web sites. So we will use a magent open source software to solve this problem.
magent is an open source proxy service software, we can achieve the synchronization of cached data through him, of course, the synchronization here is not to say that between memcached can communicate with each other, but magent can back up data, and magent can simultaneously connect more A memcached node, when memcached restart or downtime recovery from the magent specified memcached backup node to restore the lost cache data.
Through the figure to explain the principle:
Mageng will specify the main memcached node and the backup memcached node at startup. Suppose we designate two main cache nodes and one backup node. When the client writes, the algorithm writes to one of the designated main cache nodes And backs up the data to the memcached backup node, recovering the lost cache data from the backup node when the write node restarts or after the downtime is restored.
At the same time magent can also use keepalived to achieve high availability.