Not Connected if any Redis node is down

[ad_1]

Hi!

I have a two-node master-slave redis system setup. If I stop the redis server on either node the Redis Object Cache plugin loses connection instead of connecting to the remaining node.

In the scenario, I have stopped the redis on the local host. With a test Predis client, I can still connect and read from the replica but the plugin says Not connected although the other redis server (slave) is still intact.

Error in diagnostics:

Status: Not connected
Client: Predis (v2.0.3)
Drop-in: Valid
Disabled: No
Ping: PONG
Errors: [
    "Connection refused [tcp:\/\/127.0.0.1:6379]"
]

My related configuration in wp-config.php:

/* REDIS CONFIGURATION */
define( 'WP_REDIS_CLIENT', 'predis' );
define( 'WP_REDIS_SERVERS', [
    'tcp://127.0.0.1:6379?database=0&alias=master&role=master',
    'tcp://192.168.40.105:6379?database=0&alias=replica',
] );
define( 'WP_REDIS_TIMEOUT', 1 );
define( 'WP_REDIS_READ_TIMEOUT', 1 );

Can you please help me with this? Is this how it is supposed to work?
My goal is to use Redis Object Cache connected to this two-node setup. If the master goes down the replica should be able to keep serving the cache.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer