Redis cluster support and configuration

Hi everybody,

I can’t figure out how to configure nextcloud to use a external redis cluster with master and slaves as a cache.
I have read that this is supported, but despite of very long and deep searches on the web, i couldn’t find any explanation on how to configure it.

I have a two nodes redis cluster working, with a master and a slave. If I configure the master node in the nextcloud config.php file, it works like a charm. But if the master redis node fails, nothing seems to handle the redirection on the old slave and promote it as new master.

Maybe I should use somewhere redis-sentinel to promote the slave to master, but how announce it to nextcloud ?

If someone has informations about that, or links where I can find it, thanks a lot !

Best regards.

Maybe I found the beginning of a response by exploring files on the Nextcloud Server Github page.

I found there a commit called ‘redis cluster support added’, where there are modifications in the config.sample.php file talking about Redis clustering.

There is this section in that file :

/**
 * Connection details for a Redis Cluster
 *
 * Only for use with Redis Clustering, for Sentinel-based setups use the single
 * server configuration above, and perform HA on the hostname.
 *
 * Redis Cluster support requires the php module phpredis in version 3.0.0 or higher.
 *
 * Available failover modes:
 *  - \RedisCluster::FAILOVER_NONE - only send commands to master nodes (default)
 *  - \RedisCluster::FAILOVER_ERROR - failover to slaves for read commands if master is unavailable
 *  - \RedisCluster::FAILOVER_DISTRIBUTE - randomly distribute read commands across master and slaves
 */
'redis.cluster' => [
	'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required
		'localhost:7000',
		'localhost:7001'
	],
	'timeout' => 0.0,
	'read_timeout' => 0.0,
	'failover_mode' => \RedisCluster::FAILOVER_DISTRIBUTE
],

I will rebuild my Redis clustering setup with the new clustering capabilities of Redis 3.0 (which seems not use redis-sentinel to promote masters), and then install a nextcloud server using these settings to check if all is working, then I’ll let you know the results.

1 Like

I have implemented Netflix Dynomite ( https://github.com/Netflix/dynomite ) as an active-active Redis cluster. Works nice and you don’t have to do any failover management/configuration in Nextcloud.

Did you have any luck?