Configuring REDIS to work with multiple servers
|This feature is not available to users of the Squiz Experience Cloud version of Funnelback.|
This page describes how to configure Redis to work with multiple servers. This guide assumes that there’s only one administration server, and multiple query processors.
With one administration server and multiple query processors the usual way to configure Redis is to use a master/slave approach: The administration server is made the master, and each query processor is configured as slaves of this master.
The configuration requires the following steps:
Ensure that the master listens to the correct network interface
Configure the slaves to connect and authenticate to the master
All modifications of the Redis configuration should be made in
SEARCH_HOME/conf/redis.conf. Do not modify the
SEARCH_HOME/conf/redis.conf.default file as it will get overwritten during upgrades.
The master server must be configured so that Redis will listen to the appropriate network interface (the interface to which the others servers are connected). By default Redis is configured to listen to
localhost only and will refuse any external connections.
To configure the network interface, edit
SEARCH_HOME/conf/redis.conf and add the following line:
This will cause Redis to listen to all network interfaces. If you want to restrict it to a specific interface, use the appropriate IP address of the interface, e.g.:
For this configuration to take effect, you’ll need to restart the
Also make sure that the firewall(s) protecting the Redis master are configured to allow connections to the Redis port. The default Redis port is 6379 and can be changed by using the
The slaves must be told to connect to the master, and use the proper authentication password. Edit
SEARCH_HOME/conf/redis.conf on the slaves, and add:
slaveof master_hostname master_port masterauth master_passwd
Host name of the master server
Port of the master server.
Password of the master server.The password can be retrieved from
SEARCH_HOME/conf/redis.password.conf.default on the master server:
Once configured, the
funnelback-redis service on the slaves must be restarted.
Assuming the master server hostname is search-admin.company.com and its password is 1234abcd, the following lines should be added to
SEARCH_HOME/conf/redis.conf on the slaves:
slaveof search-admin.company.com 6379 masterauth 1234abcd
Once all services have been restarted, the
SEARCH_HOME/log/redis.log files on the master and slaves should contain traces of the master / slave replication.
On the master:
 01 Oct 11:39:00 * Slave ask for synchronization  01 Oct 11:39:00 * Starting BGSAVE for SYNC  01 Oct 11:39:00 * Background saving started by pid 32043  01 Oct 11:39:00 * DB saved on disk  01 Oct 11:39:00 * Background saving terminated with success  01 Oct 11:39:00 * Synchronization with slave succeeded
On the slave:
 01 Oct 11:39:00 * Connecting to MASTER...  01 Oct 11:39:00 * MASTER <-> SLAVE sync started  01 Oct 11:39:00 * Non blocking connect for SYNC fired the event.  01 Oct 11:39:00 * MASTER <-> SLAVE sync: receiving 1355 bytes from master  01 Oct 11:39:00 * MASTER <-> SLAVE sync: Loading DB in memory  01 Oct 11:39:00 * MASTER <-> SLAVE sync: Finished with success
In case the current master fails, a new master can be promoted. To do so:
Edit the new master configuration to listen to the proper network interface
If the new master was a slave previously, remove the
slaveofstatement from its configuration file
Edit the slave’s configuration and update the
slaveofstatement to point to the new master
Restart all services (master first, then slaves)
The most common sources of errors are:
Network related connection problems:
Is Redis listening to the correct interface?
Is the port properly configured?
Is the firewall letting the Redis connections in?
Are the master and the slaves sharing the same password?
Was Redis restarted after the password was changed?