Skip to content

Instantly share code, notes, and snippets.

@kaorimatz
Created November 18, 2012 13:18
Show Gist options
  • Save kaorimatz/4105223 to your computer and use it in GitHub Desktop.
Save kaorimatz/4105223 to your computer and use it in GitHub Desktop.
Configuration of redis master/slave replication
Vagrant::Config.run do |config|
config.vm.define :master do |master_config|
master_config.vm.box = "precise64"
master_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
master_config.vm.network :hostonly, "192.168.33.10"
master_config.vm.provision :chef_solo do |chef|
chef.add_recipe "redisio::install"
chef.add_recipe "redisio::enable"
chef.json = {
redisio: {
servers: [
{
port: 6379,
logfile: '/var/log/redis-master.log'
}
]
}
}
end
end
config.vm.define :slave do |slave_config|
slave_config.vm.box = "precise64"
slave_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
slave_config.vm.network :hostonly, "192.168.33.11"
slave_config.vm.provision :chef_solo do |chef|
chef.add_recipe "redisio::install"
chef.add_recipe "redisio::enable"
chef.json = {
redisio: {
servers: [
{
port: 6379,
logfile: '/var/log/redis-slave.log',
slaveof: {
address: '192.168.33.10',
port: 6379
}
}
]
}
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment