Child pages
  • Running Redis on the SICE Unified Linux Systems
Skip to end of metadata
Go to start of metadata

If you have an account on the SICE burrow systems (burrow.sice.indiana.edu, aka. silo.sice.indiana.edu) you can run a redis server under your own account with no intervention needed by the systems staff.  This page presents a cookbook example of how you can do this.  In these steps, you will need to replace "username" with your actual IU username.

 

  1. Log into the burrow server (burrow.sice.indiana.edu, aka silo.sice.indiana.edu) using ssh, PuTTY, or some other SSH client.  All of the following steps must be done while logged into the burrow server.
  2. Create a directory in your homedir to save the needed files.  In this example we will use a redis directory.

    mkdir /u/username/redis
    
  3. Copy in the default redis configuration file into this directory

    cp /etc/redis.conf /u/username/redis/redis.conf
  4. Edit the /u/username/redis/redis.conf file, making the following changes:

     

    • Change the paths for pidfile, logfile, and dir from things like /var/log/redis/redis.log to /u/username/redis/redis.log.  You must make sure that you have no paths that point into /var/.  Here are typical values:

      • pidfile /u/username/redis/redis.pid

      • logfile /u/username/redis//redis.log

      • dir /u/username/redis

    • Change the port number from the default (6379) to some other random port that must be greater than 10,000.  You can use the checkport command to check if a port is available.  For example, if you wanted to use port 12233 then run "checkport 12233" to verify that it is available.

  5. Start the service with:

    redis-server /u/username/redis/redis.conf

    When you run redis-server, it will not run in what is called daemon mode.  What that means is that the command will run normally but it will not return to the command prompt.  You could open multiple ssh login sessions and have redis-server running in one window and your other code in the other.  Furthermore, when you exit the ssh login where your redis-server is running, the process will stop.  If, instead, you want it to keep running in daemon mode, you can edit your redis.conf file and change "daemonize no" to "daemonize yes".  That way, when you run redis-server, you will immediately get the command prompt back and the process will continue running in the background.  If you do run this in daemon mode, you can kill the process using the pid file like this:

    kill `cat /u/username/redis/redis.pid`
  6. Connect to the redis server:

    redis-cli -p 12345

    You must replace 12345 with the unique port number you assigned in the redis.conf file (from step 4).  The redis-cli tool is a simple way to test connectivity to verify the service is running and listening properly.

  7. The default configuration will only allow connections from silo itself via what is called localhost.  If you need to make remote connections (say, from a cgi or php script) then you will need to make a change to your redis.conf file.  You will have to change the line "bind 127.0.0.1" to "bind 0.0.0.0" and restart your server.  

    As above, you will need to replace 12345 with the proper port number.

    If you configure redis to listen on the network, you must secure the installation.  Leaving a redis server up on the network with no authentication is leaving the service ripe for abuse and is against IU and SICE policy.  Please see the Securing Redis Instructions for more information.

If you have any trouble with these steps, you can request assistance as explained in How do I ask for help with a technology or facilities issue?