Ruby On Rails : Redis Server : Sidekiq : How to Install Redis in Ubuntu 14.04

What is Redis?

Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets,sorted sets, bitmaps and hyperloglogs.

How to install?

Download the latest and stable tar file from the following link or from anywhere you like

$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz

Untar (like Unzip)  it and switch into that directory:

$ tar xzf redis-2.8.9.tar.gz
# Or simply right click on the file and click 'Extract'
$ cd redis-2.8.9

Proceed to with the make command:

$ make

Run the recommended make test:

$ make test

Finish up by running make install, which installs the program system-wide.

$ sudo make install

Once the program has been installed, Redis comes with a built in script that sets up Redis to run as a background daemon.

To access the script move into the utils directory:

$ cd utils

From there, run the Ubuntu/Debian install script:

$ sudo ./install_server.sh

It will ask the following

Welcome to the redis service installer
This script will help you easily set up a running redis server
> Please select the redis port for this instance: [6379]
# You can enter the port you like, 6379 is default : Suggested to change
# Or you can just press ENTER, it will use default PORT
Selecting default: 6379
> Please select the redis config file name [/etc/redis/6379.conf] 
# You can just press ENTER, it will use default PORT
Selected default - /etc/redis/6379.conf
> Please select the redis log file name [/var/log/redis_6379.log] 
# You can just press ENTER, it will use default PORT

Run Redis-Server

$ redis-server
Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

Note: Creating Server TCP listening socket *:6379: bind: Address already in use then
$ redis-cli ping
> pong
# If it returns 'pong' then an instance already exists
$ redis-cli
127.0.0.1:6379> shutdown
not connected> exit
# exit command exits the cli
# you can again try
$ redis-server

References:

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis

http://redis.io/

2 thoughts on “Ruby On Rails : Redis Server : Sidekiq : How to Install Redis in Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s