Read more

Run multiple Redis servers on Ubuntu

Kim Klotz
April 12, 2012Software engineer at makandra GmbH

This was done with an older version of Ubuntu and probably wont work anymore.

This is a way to run multiple redis server on one ubuntu server.

These steps you have to do only once:

  • Adjust init script
Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show snapshot

Change some Variables.
From this:


to this:

NAME=`basename ${0}`
  • Move redis configuration
    mv /etc/redis/redis.conf /etc/redis/redis-server.conf

These steps you have to do for every new redis server:

  • Copy configuration:
    cp /etc/redis/redis-server.conf /etc/redis/redis-server2.conf

  • In the /etc/redis/redis-server2.conf you have to change at least this options:
    pidfile /var/run/
    port 6379
    logfile /var/log/redis/redis-server.log
    dir /var/lib/redis

to this for example:

pidfile /var/run/
port 6380
logfile /var/log/redis/redis-server2.log
dir /var/lib/redis2
  • Symlink the init script:
    ln -s /etc/init.d/redis-server /etc/init.d/redis-server2

  • Create working directory:
    mkdir /var/lib/redis2; chown redis.redis /var/lib/redis2;

  • Start server and add init script to system startup
    /etc/init.d/redis-server2 start
    update-rc.d redis-server2 defaults

Kim Klotz
April 12, 2012Software engineer at makandra GmbH
Posted by Kim Klotz to makandra Operations (2012-04-12 18:22)