O'Reilly logo

Redis 4.x Cookbook by Zuofei Wang, Pengcheng Huang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To test the Redis Cluster set up in the previous recipe, we will first start the testing program as a Redis client by the following command:

~$ ruby coding/redis-rb-cluster/consistency-test.rb 192.168.1.59 6380 
1441 R (0 err) | 1441 W (0 err) |  
4104 R (0 err) | 4104 W (0 err) |  
25727 R (0 err) | 25727 W (0 err) | 
... 
  1. Simulating a master down: 
    1. Make the instance I_A crash using the Redis DEBUG SEGFAULT command:
redis@192.168.1.57:~> bin/redis-cli -h 192.168.1.57 -p 6379 -c DEBUG SEGFAULTError: Server closed the connection
    1.  Check the log of the I_A instance:
96013:M 15 Nov 14:49:40.224 # Redis 4.0.1 crashed by signal: 11
    1. Check the output of the testing program:
190927 R (0 err) | 190927 W (0 err) |201012 R ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required