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) | ...
- Simulating a master down:
- 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
-
- Check the log of the I_A instance:
96013:M 15 Nov 14:49:40.224 # Redis 4.0.1 crashed by signal: 11
-
- Check the output of the testing program:
190927 R (0 err) | 190927 W (0 err) |201012 R ...