Redis Image Guide Version 5


Redis is an in-memory key-value store known for its flexibility, performance, and wide language support.

Image Environment:

Redis version: 5.0.7. Operating system: Centos 7, Ubuntu 16, Ubuntu 18.

Launch an Instance from an Image:

  • Login into bluvalt horizon with your “username” and “password”.
  • Then go to (Project → Compute → Instances).
  • On Instances page, click Launch Instance button at the top right corner then, Launch Instance dialog will appear

Redis Directory:

  • Redis main directory: /etc/redis.
  • Log directory: /var/log.
  • Redis configuration file: /etc/redis/ redis.conf.

Create user, group and directory:

  • Begin by creating the redis user and group. This can be done in a single command by typing:

      sudo adduser --system --group --no-create-home redis 
  • Now, we can create the /var/lib/redis directory by typing:

      sudo mkdir /var/lib/redis
  • We should give the redis user and group ownership over this directory:

      sudo chown redis:redis /var/lib/redis 
  • Adjust the permissions so that regular users cannot access this location:

      sudo chmod 770 /var/lib/redis 

Start Redis

  • Start the Redis Service / Start up the systemd service by typing:

      sudo systemctl start redis 
  • Check that the service status:

      sudo systemctl status redis 

You should see something that looks like this:

 redis.service - Redis Server  
 Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)  
 Active: active (running) since Wed 2016-05-11 14:38:08 EDT; 1min 43s ago  Process: 3115 ExecStop=/usr/local/bin/redis-cli shutdown (code=exited, status=0/SUCCESS) 
 Main PID: 3124 (redis-server)     
 Tasks: 3 (limit: 512)    
 Memory: 864.0K    
 CPU: 179ms 6 
 CGroup: /system.slice/redis.service  
 └─3124 /usr/local/bin/redis-server  

Test Redis Functionality

  • To test functioning, connect to the Redis server with the command-line client:

  • In the prompt that follows, test connectivity by typing:

  • You should see:

  • Check that you can set keys by typing:

      set test "It's working!"
      Output OK 
  • Now, retrieve the value by typing:

      get test
  • You should be able to retrieve the value we stored:

      "It's working!" 
  • Exit the Redis prompt to get back to the shell:

  • As a final test, let’s restart the Redis instance:

      sudo systemctl restart redis 
  • Now, connect with the client again and confirm that your test value is still available:

      get test  
  • The value of your key should still be accessible:

      "It's working!" 
  • Back out into the shell again when you are finished:


Check Redis version:

redis-server -v