redis_failover 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.md CHANGED
@@ -1,6 +1,12 @@
1
+ 0.8.6
2
+ -----------
3
+ - No longer buffer output (kyohsuke)
4
+ - Update redis/zk gem versions to latest (rudionrails)
5
+
1
6
  0.8.5
2
7
  -----------
3
8
  - Lock-down gemspec to version 1.1.x of redis-namespace to play nicely with redis 2.2.x.
9
+ - Fix RedisFailover::Client#manual_failover regression (oleriesenberg)
4
10
 
5
11
  0.8.4
6
12
  -----------
data/README.md CHANGED
@@ -141,7 +141,7 @@ redis_failover uses YARD for its API documentation. Refer to the generated [API
141
141
 
142
142
  ## Requirements
143
143
 
144
- - redis_failover is actively tested against MRI 1.9.2/1.9.3 and JRuby 1.6.7 (1.9 mode only). Other rubies may work, although I don't actively test against them. 1.8 is not supported.
144
+ - redis_failover is actively tested against MRI 1.9.2/1.9.3 and JRuby 1.6.7 (1.9 mode only). Other rubies may work, although I don't actively test against them.
145
145
  - redis_failover requires a ZooKeeper service cluster to ensure reliability and data consistency. ZooKeeper is very simple and easy to get up and running. Please refer to this [Quick ZooKeeper Guide](https://github.com/ryanlecompte/redis_failover/wiki/Quick-ZooKeeper-Guide) to get up and running quickly if you don't already have ZooKeeper as a part of your environment.
146
146
 
147
147
  ## Considerations
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $stdout.sync = true
3
4
  require 'redis_failover'
4
5
 
5
6
  RedisFailover::Runner.run(ARGV)
@@ -40,6 +40,10 @@ module RedisFailover
40
40
  options[:config_file] = file
41
41
  end
42
42
 
43
+ opts.on('--with-chroot ROOT', 'Path to ZooKeepers chroot') do |chroot|
44
+ options[:chroot] = chroot
45
+ end
46
+
43
47
  opts.on('-E', '--environment ENV', 'Config environment to use') do |config_env|
44
48
  options[:config_environment] = config_env
45
49
  end
@@ -82,7 +82,7 @@ module RedisFailover
82
82
  # Configures the ZooKeeper client.
83
83
  def setup_zk
84
84
  @zk.close! if @zk
85
- @zk = ZK.new(@options[:zkservers])
85
+ @zk = ZK.new("#{@options[:zkservers]}#{@options[:chroot] || ''}")
86
86
 
87
87
  @zk.register(@manual_znode) do |event|
88
88
  @mutex.synchronize do
@@ -1,3 +1,3 @@
1
1
  module RedisFailover
2
- VERSION = '0.8.5'
2
+ VERSION = '0.8.6'
3
3
  end
@@ -15,10 +15,10 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = RedisFailover::VERSION
17
17
 
18
- gem.add_dependency('redis', '~> 2.2')
19
- gem.add_dependency('redis-namespace', '~> 1')
18
+ gem.add_dependency('redis', '~> 3')
19
+ gem.add_dependency('redis-namespace')
20
20
  gem.add_dependency('multi_json', '~> 1')
21
- gem.add_dependency('zk', '~> 1.4')
21
+ gem.add_dependency('zk', '~> 1.6')
22
22
 
23
23
  gem.add_development_dependency('rake')
24
24
  gem.add_development_dependency('rspec')
data/spec/cli_spec.rb CHANGED
@@ -36,6 +36,16 @@ module RedisFailover
36
36
  opts[:max_failures].should == 1
37
37
  end
38
38
 
39
+ it 'properly parses a chroot' do
40
+ opts = CLI.parse(['-n host:port', '-z localhost:1111', '--with-chroot', '/with/chroot/from/command/line'])
41
+ opts[:nodes].should == [{
42
+ :host => 'host',
43
+ :port => 'port',
44
+ }]
45
+
46
+ opts[:chroot].should == '/with/chroot/from/command/line'
47
+ end
48
+
39
49
  it 'properly parses the config file' do
40
50
  opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/single_environment.yml"])
41
51
  opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181'
@@ -46,6 +56,20 @@ module RedisFailover
46
56
  opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/multiple_environments.yml", '-E', 'staging'])
47
57
  opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181'
48
58
  end
59
+
60
+ it 'properly parses the config file that include chroot' do
61
+ opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/single_environment_with_chroot.yml"])
62
+ opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181'
63
+ opts[:chroot].should == '/with/chroot'
64
+
65
+ opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/multiple_environments_with_chroot.yml", '-E', 'development'])
66
+ opts[:zkservers].should == 'localhost:2181'
67
+ opts[:chroot].should == '/with/chroot_development'
68
+
69
+ opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/multiple_environments_with_chroot.yml", '-E', 'staging'])
70
+ opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181'
71
+ opts[:chroot].should == '/with/chroot_staging'
72
+ end
49
73
  end
50
74
  end
51
75
  end
@@ -0,0 +1,17 @@
1
+ :development:
2
+ :nodes:
3
+ - localhost:6379
4
+ - localhost:6389
5
+ :zkservers:
6
+ - localhost:2181
7
+ :chroot: /with/chroot_development
8
+
9
+ :staging:
10
+ :nodes:
11
+ - redis01:6379
12
+ - redis02:6379
13
+ :zkservers:
14
+ - zk01:2181
15
+ - zk02:2181
16
+ - zk03:2181
17
+ :chroot: /with/chroot_staging
@@ -0,0 +1,8 @@
1
+ :nodes:
2
+ - redis01:6379
3
+ - redis02:6379
4
+ :zkservers:
5
+ - zk01:2181
6
+ - zk02:2181
7
+ - zk03:2181
8
+ :chroot: /with/chroot
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_failover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-14 00:00:00.000000000 Z
12
+ date: 2012-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '2.2'
21
+ version: '3'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,23 +26,23 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '2.2'
29
+ version: '3'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: redis-namespace
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: '1'
37
+ version: '0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: '1'
45
+ version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: multi_json
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '1.4'
69
+ version: '1.6'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '1.4'
77
+ version: '1.6'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rake
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +162,9 @@ files:
162
162
  - spec/node_watcher_spec.rb
163
163
  - spec/spec_helper.rb
164
164
  - spec/support/config/multiple_environments.yml
165
+ - spec/support/config/multiple_environments_with_chroot.yml
165
166
  - spec/support/config/single_environment.yml
167
+ - spec/support/config/single_environment_with_chroot.yml
166
168
  - spec/support/node_manager_stub.rb
167
169
  - spec/support/redis_stub.rb
168
170
  - spec/util_spec.rb
@@ -180,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
182
  version: '0'
181
183
  segments:
182
184
  - 0
183
- hash: -3012770185643585343
185
+ hash: -645312591667792014
184
186
  required_rubygems_version: !ruby/object:Gem::Requirement
185
187
  none: false
186
188
  requirements:
@@ -189,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
191
  version: '0'
190
192
  segments:
191
193
  - 0
192
- hash: -3012770185643585343
194
+ hash: -645312591667792014
193
195
  requirements: []
194
196
  rubyforge_project:
195
197
  rubygems_version: 1.8.23
@@ -205,7 +207,9 @@ test_files:
205
207
  - spec/node_watcher_spec.rb
206
208
  - spec/spec_helper.rb
207
209
  - spec/support/config/multiple_environments.yml
210
+ - spec/support/config/multiple_environments_with_chroot.yml
208
211
  - spec/support/config/single_environment.yml
212
+ - spec/support/config/single_environment_with_chroot.yml
209
213
  - spec/support/node_manager_stub.rb
210
214
  - spec/support/redis_stub.rb
211
215
  - spec/util_spec.rb