I’m Redis. I was brought into this world by a man named Antirez.

That day, baymax, who had not seen him for a long time, sent a message from his gay friends on Redis

Baymax started a new group

In the days after, our elder brother three cooperate with each other, the most in the daily work is data synchronization

If the master node has commands to write, delete, or modify data, it will also notify the slave node of these commands one by one. This is called command propagation.

In this way, the data between the master and slave nodes can be kept in sync

Once, I accidentally dropped the line

We are using a new data synchronization strategy, which is much more efficient, and even if we occasionally drop a line, we can quickly replace the missing data.

So it went on for a while

We’ve got new hands, and we’re ready to go big!

In order to obtain and update the information of master and slave nodes in time, our sentry will use INFO command to greet the master node every ten seconds, and the master node will tell me which slave nodes he has

In order to be more timely to know whether everyone is off line, our sentry will PING each friend in the group every second:

If I don’t get a response within the set time, I know the guy is probably on his knees and it’s time to start failover

But this is just my subjective opinion, and I’m not the only one who can say it. In order to prevent misjudgment, I have to ask the administrator group for their opinion:

Then we had our first election.

After some hard work, I finally failed over, and R2 is now the master node.

But before long, R1 was back:

Above is our daily work, through the concerted efforts of several of our partners, constitute a high availability cache service, MySQL brother no longer dare to look down on us.

【 the 】

Previous TOP5 articles

I’m Redis, MySQL big brother is getting screwed by me!

CPU clearly 8 core, network card why desperately toss a core?

I almost lost my job over a cross-domain request

Over! The CPU is begging for something fast!

Which hash table is stronger? The big programming languages are at each other’s throats!