Ish
Ish

Reputation: 2103

Upgrade Redis cluster Ubuntu

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.

Upvotes: 3

Views: 1561

Answers (1)

neuront
neuront

Reputation: 9622

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.

Upvotes: 0

Related Questions