Sha256: 7b6f8c0fb80fee9eb4b770e7e44d73fa429973b4a907e1ea6e2b0553f0acec91
Contents?: true
Size: 1.36 KB
Versions: 24
Compression:
Stored size: 1.36 KB
Contents
#! /usr/bin/env ruby # This is a helper script used together with examples/sentinel.rb # It runs two Redis masters, two slaves for each of them, and two sentinels. # After 30 seconds, the first master dies. # # You don't need to run this script yourself. Rather, use examples/sentinel.rb. require "fileutils" $pids = [] at_exit do $pids.each do |pid| begin Process.kill(:INT, pid) rescue Errno::ESRCH end end Process.waitall end base = File.expand_path(File.dirname(__FILE__)) # Masters $pids << spawn("redis-server --port 6380 --loglevel warning") $pids << spawn("redis-server --port 6381 --loglevel warning") # Slaves of Master 1 $pids << spawn("redis-server --port 63800 --slaveof 127.0.0.1 6380 --loglevel warning") $pids << spawn("redis-server --port 63801 --slaveof 127.0.0.1 6380 --loglevel warning") # Slaves of Master 2 $pids << spawn("redis-server --port 63810 --slaveof 127.0.0.1 6381 --loglevel warning") $pids << spawn("redis-server --port 63811 --slaveof 127.0.0.1 6381 --loglevel warning") FileUtils.cp(File.join(base, "sentinel.conf"), "tmp/sentinel1.conf") FileUtils.cp(File.join(base, "sentinel.conf"), "tmp/sentinel2.conf") # Sentinels $pids << spawn("redis-server tmp/sentinel1.conf --sentinel --port 26379") $pids << spawn("redis-server tmp/sentinel2.conf --sentinel --port 26380") sleep 30 Process.kill(:KILL, $pids[0]) Process.waitall
Version data entries
24 entries across 23 versions & 7 rubygems