Upgrading Redis to 3.0.7 using Moonshine Redis Plugin


To learn how to upgrade redis from 2.8.9 to 3.0.7 using Moonshine Redis plugin


Step 1

Uninstall the redis 2.8.9 manually on the server. Ideally I wish the plugin took care of removing the old version. But it does not install the newer version if an older version is already installed on the server.

sudo service redis-server stop
sudo rm /usr/local/bin/redis-*
sudo rm -r /etc/redis/
sudo rm /var/log/redis_*
sudo rm -r /var/lib/redis/
sudo rm /etc/init.d/redis_*
sudo rm /var/run/redis_*

Step 2

The tcl package is a pre-requisite for redis installation. In application_manifest.rb, add:

package 'tcl8.5', :ensure => :installed

Step 3

Change redis version in moonshine.yml:

  :version: 3.0.7

Step 4

Update the redis version in application_manifest.rb and make sure redis recipe is included:

configure(:redis => { :version => '3.0.7' }
recipe :redis

Step 5

Check in the changes to git. Deploy using Capistrano.

** [out :: rp] Notice: /Exec[shutdown redis]/returns: Could not connect to Redis at Connection refused
** [out :: rp] Error: /Exec[shutdown redis]: Failed to call refresh: redis-cli shutdown returned 1 instead of one of [0]
** [out :: rp] Error: /Exec[shutdown redis]: redis-cli shutdown returned 1 instead of one of [0]
** [out :: rp] Notice: /Service[redis-server]/ensure: ensure changed 'stopped' to 'running'

You may see some error messages. It's ok. Because it happens when you dick around the server like we did in step 1.

Step 6

SSH into the box and verify the new version of redis.

redis-cli> INFO
# Server

It will be better if the availability end point provides the version of redis in the JSON.


In this article, you learned how to automate upgrade of Redis as much as we can on Ubuntu using Moonshine Redis Plugin.


Moonshine Redis Plugin
How to uninstall redis server on Ubuntu

Related Articles

Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.