Skip to content

brianV/vagrant-redis-cluster

 
 

Repository files navigation

Vagrant Redis Cluster

Configures a redis cluster in vagrant

This builds on the somewhat neglected 72squared Vagrant Redis Cluster at https://github.com/72squared/vagrant-redis-cluster.

The cluster is 6 redis instances running with 3 master & 3 slaves, one slave for each master.

This release currently installs Redis 3.2.5 from the official Redis repo (https://github.com/antirez/redis). To change this, update REDIS_VERSION in redis_vars.sh.

Changes from the 72squared version

  1. Uses geerlingguy/ubuntu1604 as the underlying Box
  2. Forces '--cableconnected1=on' in VirtualBox.
  3. Adds a provisioning script to start Supervisor automatically to work around https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740
  4. Downloads the Redis 3.2.5 release instead of the latest from the 3.0 branch. Changed the underlying mechanism to install tagged releases rather than a branch.
  5. Makes Redis bind to 0.0.0.0 instead of 127.0.0.1 so we can access the Redis ports from outside the box.

Setup

How to set up vagrant and start the cluster image.

  1. Install vagrant
  2. Install VirtualBox
  3. Clone the project locally: git clone [email protected]:brianV/vagrant-redis-cluster.git
  4. Move into the project directory: cd vagrant-redis-cluster
  5. Install the vbguest plugin: vagrant plugin install vagrant-vbguest
  6. Provision the virtual machine using Vagrant: vagrant up
  7. Make sure you have the Redis CLI installed: brew install redis (Mac)
  8. Test the connection to verify everything is working: redis-cli -p 7000 (or any other cluster port)

You should now have 6 redis servers running locally at:

  • 127.0.0.1:7000
  • 127.0.0.1:7001
  • 127.0.0.1:7002
  • 127.0.0.1:7003
  • 127.0.0.1:7004
  • 127.0.0.1:7005

About

set up a vagrant vm for testing redis cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%