3

I have installed redis cluster 3.0.0. But Want to upgrade it to 3.0.7. Can somebody tell me the steps to do it?

I don't want to loose any data. And don't want any downtime either.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Ish
  • 2,085
  • 3
  • 21
  • 38

1 Answers1

0

Steps I did when upgrading from 2.9.101 to 3.0 release. I hope it will do for upgrading to 3.0.7 too.

  • Compile 3.0.7 from the source and start several instances with cluster enabled.
  • Let the 3.0.7 instances replicate the 3.0.0 instances as slave
  • Connect to each 3.0.7 instance and do a manual failover, then the 3.0.0 masters would become slaves after several seconds.
  • Wait for your application to connect to the new masters; also check the configuration files, and modify the entries to the new masters on your need
  • Remove those slaves

UPDATE : Docker approach

As it's probably unable to replacing the binary executable while the process is still alive, you could do it by run some Redis in docker.

First you should install docker on your machine and pull the Redis image, or pull a basic OS image and manually build Redis in it, whatever

Based on this image, you are supposed to

  • copy your current redis.conf into it
  • make sure the dir exists in the image (cluster-config-file could be the same for all the containers as they are saved individually in their own fs)
  • make sure the directory for logfile exists and is not the same as dir (we will later map this directory to the host)
  • leave port logfile anything you like, as they are specified when a container is started
  • commit the image as redis-3.0.7

Now launch a containerized Redis. I suppose your logfile is located in /var/log/redis/, this Redis binds :8000, and your config file in the image is /etc/redis/redis.conf

docker run -d --net=host -v /var/log/redis:/var/log/redis \
        -p 8000:8000 -t redis-3.0.7 \
    /usr/bin/redis-server /etc/redis/redis.conf \
        --port 8000 \
        --logfile /var/log/redis/redis_8000.log

Now you have a Redis 3.0.7 instance, and are ready to finish the rest steps in the previous part.

neuront
  • 9,312
  • 5
  • 42
  • 71
  • I have just 2 cores in the machine. Adding another redis in the same machine would work ? – Ish May 11 '16 at 13:06
  • @Ish The replications don't use much CPU loads and you could replace them one by one. But I'm afraid it is a problem that you replace the redis-server executable while the 3.0 instances are still serving. I did that in separated machines. – neuront May 12 '16 at 00:54
  • I would like to do in the same machines. – Ish May 12 '16 at 07:15
  • @lsh Updated my answer. I'm afraid this is a little sophisticated as basic knowledge about docker is needed. Anyway it is workable (at least for me, I don't know if anyone else run Redis in docker containers). Hope this could help. – neuront May 12 '16 at 09:08