Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Record an accident caused by Redis Cluster downtime

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduction:

Redis officially claims to support concurrent 110000 read operations and 80 000 write operations. Due to its excellent performance and convenient operation, I believe many people have used Redis in their projects. In order to prevent applications from relying too much on Redis services, Redis is only used to improve application concurrency and reduce application response time. Even if Redis is abnormal, applications should not fail to provide services. Paixin recently arranged an environment-wide Redis Cluster downtime exercise.

Xu Bin: the person in charge of the pat letter structure.

Zhu Rongsong: Paixin architecture development engineer.

I. exercise process

Redis cluster environment:

1. Test environment:

Redis Cluster configuration: Redis 3 master 3 slave a total of 6 nodes.

two。 Pre-release environment:

Redis Cluster configuration: Redis 3 master 3 slave a total of 6 nodes.

The following is the timeline of our operation:

First day

Any slave node is closed during the operation of the program, and there is no exception for one day of the test.

The second day

Any slave node was closed while the program was running, no exception was found in the program, and no exception was found in the test for one day.

The third day

There is an application release version in the pre-release environment, and the program cannot be started if there is an exception.

……

Second, the description of the problem begins with several premises:

1. The test and pre-launch environment is currently shutting down any Redis slave node.

two。 After repeated tests, the test environment began to shut down the pre-issued environment node.

3. The exception disappears after the pre-issued environment restarts the closed Redis node.

4. The Redis client is connected using Jedis, which is widely used in the Java language.

So why is there no problem in the test environment after repeated testing, but there will be problems in the pre-release environment?

Third, principle

Before analyzing the problem, briefly explain the principle of Redis Cluster implementation. To put it simply, Redis

Scene

Operation (multiple nodes operate at the same time)

Total number of Redis writes

Total Redis readings

Error amount

Total time spent (s)

Error rate

The program is running

Guan master (Guan any master)

100000

100000

3084

one hundred

0.031

Guan master (Guan any master)

100000

100000

1482

one hundred and two

0.015

Guan master (Guan any master)

100000

100000

3053

97.6

0.031

Guan Cong (Guan Yi Cong)

100000

100000

0

109.2

0

Guan Cong (Guan Yi Cong)

100000

100000

0

90.1

0

Guan Cong (Guan Yi Cong)

100000

100000

0

88.9

0

Master and follower close together (Guan any pair)

100000

100000

32613

210.1

0.326

Master and follower close together (Guan any pair)

100000

100000

29148

169.8

0.291

Master and follower close together (Guan any pair)

100000

100000

32410

173.7

0.324

All the masters are closed.

100000

100000

100000

353.4

one

All from the whole customs

100000

100000

0

87.7

0

Only one master is left.

100000

100000

100000

357.1

one

Table 1

From the test results, the election process of cluster Master is participated by Master.

1. If more than half of the Master is turned off, the entire cluster is unavailable.

two。 Shutting down any pair of master and slave nodes will result in partial failure (about 1A3 of the entire cluster).

3. Shutting down any master will cause some write operations to fail because the slave node cannot perform write operations and there will be a small number of failures during the upgrade from Slave to Master.

4. Shutting down the slave node has no effect on the whole cluster.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report