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

Version Path
finsync_redis-3.3.5 examples/sentinel/start
redis-4.0.3 examples/sentinel/start
redis-4.1.0.beta1 examples/sentinel/start
redis-4.0.2 examples/sentinel/start
redis-3.3.5 examples/sentinel/start
redis-4.0.1 examples/sentinel/start
redis-4.0.0 examples/sentinel/start
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/sentinel/start
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/sentinel/start
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/sentinel/start
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/sentinel/start
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/examples/sentinel/start
redis-3.3.3 examples/sentinel/start
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/examples/sentinel/start
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/examples/sentinel/start
redis-4.0.0.rc1 examples/sentinel/start
redis-3.3.2 examples/sentinel/start
redis-3.3.1 examples/sentinel/start
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/examples/sentinel/start
redis-3.3.0 examples/sentinel/start