I ran into this exact problem with redis Version: 2: 2.2.12-1build1 on Ubuntu 12.04.1 LTS.
Diagnostics
The @harishkumarv configuration file is a self-documenting example for redis version 2.6 . Their example has a configuration option verbatim.
# TCP keepalive.
Note that their example is 0. This probably works in version 2.6, but apparently is not supported in 2.4, where it is not included in the sample configuration file for this version. In addition, we must assume that it is not supported in 2.2. It would be nice if their "self-documenting" files covered the version that included certain configuration parameters.
So why am I / used 2.2? This is the only version available for the Amazon EC2 Ubuntu AMI-based Ubuntu package manager. I will do some research and see if I can find a channel for 2.4-2.8 redis releases , but I canβt hold my breath.
Debugging tools
Verified version of redis with dpkg -s redis-server
Checked version of ubuntu with lsb_release -a
Checked available versions of redis with apt-cache madison redis-server
Decision
Comment or delete this line from the configuration file. Also, use version 2.4 of the sample configuration file if you are using redis version 2.4. The same goes for 2.8 and 2.2 .
The best solution
I found apt way to get the latest version of redis for ubuntu on askubuntu ; thank you very much enzotib .
You can use the following PPA: https://launchpad.net/~rwky/+archive/redis .
You can install this repo by running the command:
sudo add-apt-repository ppa:rwky/redis
then update package information
sudo apt-get update
finally install the application
sudo apt-get install redis-server
This leads to the latest redis available in the rwky repository, which is currently a purpose-built version for specific releases of Ubuntu (e.g. 2:2.8.1-rwky1~precise targets Ubuntu 12.04 Precise Pangolin). Indication of version number, for example:
apt-get -q -y install redis-server=2.8.1-rwky1~precise
didn't work for me creating an error
STDERR: E: Version '2.8.1-rwky1~precise' for 'redis-server' was not found
Think about it, the simpler version number redis-server=2.8.1 also doesn't work. But ok, 2.8.1 is what I want, and 2.8.1 is what installs after this fix. I should also note that this package for 2.8.1 will copy an example configuration file to the /etc/redis/redis.conf directory, so be prepared if you have a previously configured configuration file, especially if you are updating through a script. You will receive an invitation of the following form:
Configuration file `/etc/redis/redis.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** redis.conf (Y/I/N/O/D/Z) [default=N] ?
And if your script or apt-get command accepts yes (as in apt-get -y ), you will replace your custom conf file with an example.