Setting up a Redis server is very simple to do. Simply install the software, make a few configuration changes, and startup the service. In the example below, we will show how to install Redis on a single server.

Install Redis
# mkdir /redis
# cd /redis
# wget
# tar xzf redis-3.0.2.tar.gz
# cd redis-3.0.2
# apt-get update
# apt-get install make
# apt-get install build-essential
# cd deps; make hiredis lua jemalloc linenoise
# cd /redis/redis-3.0.2
# make
#cd /
#chown -R redis redis

Run Redis
src/redis-server &

Test Redis
redis> set foo bar
redis> get foo

Configure Redis
# vi /redis/redis-3.0.2/redis.conf

To configure replication is trivial: just add the following line to the slave configuration file:
# slaveof <masterip> <masterport>
slaveof 6379

Redis does not requires root privileges to run. It is recommended to run it as an unprivileged redis user that is only used for this purpose.

Leave a Reply

Your email address will not be published. Required fields are marked *