Wednesday, April 22, 2015

Install Redis 3.0.0 on Ubuntu 14.04.2 Server

Redis now officially only supports Linux-based OS. Here I installed Redis in Ubuntu 14.04.2 Server and the version is 3.0. First I need to download it from here.

Open the terminal and input the command as follow:
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
After download completed, uncompress the zipped file:
  
tar xzv -f redis-3.0.0.tar.gz
Enter the redis-3.0.0 folder and excuted the make command:
 
cd redis-3.0.0
make 
If the make is not found, excute the command below to install it:
 
sudo apt-get install make
If the error message shows as below:
/bin/sh: 1: cc: not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/home/javakid/tools/nosql/redis-3.0.0/src'
make: *** [all] Error 2
Then installing build-essential is needed.
 sudo apt-get install build-essential
If something is missing as the message here:
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
                               ^
The solution is to make the lacking file:
cd deps 
make jemalloc
Go back to redis-3.0.0 and execute make command again.

If the error below occured:
cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/home/javakid/tools/nosql/redis-3.0.0/src'
make: *** [all] Error 2
Just go to the folder deps and make the lacking files:
cd deps
make hiredis lua jemalloc linenoise
Go back to parent folder and execute the make command after the files are made.
cd ../
make
When the make command is completed, execute the command below to start Redis.
 src/redis-server