big_brother 0.6.8 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/Changelog.md +5 -0
- data/big_brother.gemspec +1 -1
- data/lib/big_brother.rb +4 -0
- data/lib/big_brother/active_active_cluster.rb +157 -0
- data/lib/big_brother/active_passive_cluster.rb +61 -0
- data/lib/big_brother/cluster.rb +28 -13
- data/lib/big_brother/cluster_collection.rb +3 -0
- data/lib/big_brother/cluster_factory.rb +16 -0
- data/lib/big_brother/configuration.rb +21 -3
- data/lib/big_brother/health_fetcher.rb +12 -0
- data/lib/big_brother/node.rb +35 -10
- data/lib/big_brother/version.rb +1 -1
- data/lib/resources/config_schema.yml +92 -0
- data/spec/big_brother/active_active_cluster_spec.rb +437 -0
- data/spec/big_brother/active_passive_cluster_spec.rb +172 -0
- data/spec/big_brother/app_spec.rb +13 -11
- data/spec/big_brother/cluster_collection_spec.rb +26 -0
- data/spec/big_brother/cluster_factory_spec.rb +23 -0
- data/spec/big_brother/cluster_spec.rb +60 -18
- data/spec/big_brother/configuration_spec.rb +72 -27
- data/spec/big_brother/health_fetcher_spec.rb +47 -2
- data/spec/big_brother/node_spec.rb +42 -68
- data/spec/big_brother/ticker_spec.rb +6 -2
- data/spec/big_brother_spec.rb +85 -55
- data/spec/support/example_config.yml +65 -39
- data/spec/support/factories/cluster_factory.rb +9 -1
- data/spec/support/null_logger.rb +9 -0
- metadata +30 -25
@@ -1,40 +1,66 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
-
|
39
|
-
|
40
|
-
|
2
|
+
_big_brother:
|
3
|
+
offset: 10000
|
4
|
+
clusters:
|
5
|
+
- cluster_name: test1
|
6
|
+
check_interval: 1
|
7
|
+
backend_mode: "active_passive"
|
8
|
+
scheduler: wrr
|
9
|
+
fwmark: 1
|
10
|
+
ramp_up_time: 120
|
11
|
+
has_downpage: true
|
12
|
+
nagios:
|
13
|
+
server: nsca.host
|
14
|
+
check: test1_status
|
15
|
+
host: prod-load
|
16
|
+
nodes:
|
17
|
+
- address: 127.0.0.1
|
18
|
+
port: 9001
|
19
|
+
max_weight:
|
20
|
+
path: /test/valid
|
21
|
+
priority: 0
|
22
|
+
- address: 127.0.0.1
|
23
|
+
port: 9002
|
24
|
+
path: /test/valid
|
25
|
+
priority: 1
|
26
|
+
- cluster_name: test2
|
27
|
+
check_interval: 2
|
28
|
+
scheduler: wrr
|
29
|
+
fwmark: 2
|
30
|
+
nodes:
|
31
|
+
- address: 127.0.0.1
|
32
|
+
port: 9001
|
33
|
+
max_weight:
|
34
|
+
path: /test/invalid
|
35
|
+
- address: 127.0.0.1
|
36
|
+
port: 9002
|
37
|
+
path: /test/invalid
|
38
|
+
- cluster_name: test3
|
39
|
+
check_interval: 1
|
40
|
+
scheduler: wrr
|
41
|
+
fwmark: 3
|
42
|
+
nodes:
|
43
|
+
- address: 127.0.0.1
|
44
|
+
port: 9001
|
45
|
+
max_weight:
|
46
|
+
path: /test/valid
|
47
|
+
- address: 127.0.0.1
|
48
|
+
port: 9002
|
49
|
+
path: /test/invalid
|
50
|
+
- cluster_name: test4
|
51
|
+
check_interval: 1
|
52
|
+
scheduler: wrr
|
53
|
+
fwmark: 4
|
54
|
+
max_down_ticks: 100
|
55
|
+
backend_mode: 'active_active'
|
56
|
+
non_egress_locations:
|
57
|
+
- 'test'
|
58
|
+
nodes:
|
59
|
+
- address: 127.0.0.1
|
60
|
+
port: 9001
|
61
|
+
path: /test/valid
|
62
|
+
max_weight:
|
63
|
+
- address: 196.168.0.2
|
64
|
+
port: 9292
|
65
|
+
interpol: true
|
66
|
+
path: /fwmark
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Factory
|
2
2
|
def self.cluster(overrides = {})
|
3
|
-
BigBrother::
|
3
|
+
BigBrother::ClusterFactory.create_cluster(
|
4
4
|
overrides.fetch(:name, 'test'),
|
5
5
|
{
|
6
6
|
:fwmark => 100,
|
@@ -11,4 +11,12 @@ class Factory
|
|
11
11
|
}.merge(overrides)
|
12
12
|
)
|
13
13
|
end
|
14
|
+
|
15
|
+
def self.active_passive_cluster(overrides = {})
|
16
|
+
self.cluster(overrides.merge(:backend_mode => BigBrother::ClusterFactory::ACTIVE_PASSIVE_CLUSTER))
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.active_active_cluster(overrides = {})
|
20
|
+
self.cluster(overrides.merge(:backend_mode => BigBrother::ClusterFactory::ACTIVE_ACTIVE_CLUSTER))
|
21
|
+
end
|
14
22
|
end
|
data/spec/support/null_logger.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: big_brother
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.7
|
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:
|
12
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thin
|
@@ -155,6 +155,22 @@ dependencies:
|
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: 0.0.2
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: kwalify
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ~>
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.7.2
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.7.2
|
158
174
|
- !ruby/object:Gem::Dependency
|
159
175
|
name: rspec
|
160
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,22 +235,6 @@ dependencies:
|
|
219
235
|
- - ~>
|
220
236
|
- !ruby/object:Gem::Version
|
221
237
|
version: '0.13'
|
222
|
-
- !ruby/object:Gem::Dependency
|
223
|
-
name: vagrant
|
224
|
-
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
|
-
requirements:
|
227
|
-
- - ! '>='
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0'
|
230
|
-
type: :development
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
|
-
requirements:
|
235
|
-
- - ! '>='
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
version: '0'
|
238
238
|
description: IPVS backend supervisor
|
239
239
|
email:
|
240
240
|
- code@getbraintree.com
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- .rake_commit
|
248
248
|
- .rvmrc
|
249
249
|
- .travis.yml
|
250
|
+
- Changelog.md
|
250
251
|
- Gemfile
|
251
252
|
- LICENSE
|
252
253
|
- README.md
|
@@ -255,10 +256,13 @@ files:
|
|
255
256
|
- bin/bigbro
|
256
257
|
- config.ru
|
257
258
|
- lib/big_brother.rb
|
259
|
+
- lib/big_brother/active_active_cluster.rb
|
260
|
+
- lib/big_brother/active_passive_cluster.rb
|
258
261
|
- lib/big_brother/app.rb
|
259
262
|
- lib/big_brother/cli.rb
|
260
263
|
- lib/big_brother/cluster.rb
|
261
264
|
- lib/big_brother/cluster_collection.rb
|
265
|
+
- lib/big_brother/cluster_factory.rb
|
262
266
|
- lib/big_brother/configuration.rb
|
263
267
|
- lib/big_brother/health_fetcher.rb
|
264
268
|
- lib/big_brother/ipvs.rb
|
@@ -269,12 +273,16 @@ files:
|
|
269
273
|
- lib/big_brother/status_file.rb
|
270
274
|
- lib/big_brother/ticker.rb
|
271
275
|
- lib/big_brother/version.rb
|
276
|
+
- lib/resources/config_schema.yml
|
272
277
|
- lib/sinatra/synchrony.rb
|
273
278
|
- lib/thin/backends/tcp_server_with_callbacks.rb
|
274
279
|
- lib/thin/callback_rack_handler.rb
|
275
280
|
- lib/thin/callbacks.rb
|
281
|
+
- spec/big_brother/active_active_cluster_spec.rb
|
282
|
+
- spec/big_brother/active_passive_cluster_spec.rb
|
276
283
|
- spec/big_brother/app_spec.rb
|
277
284
|
- spec/big_brother/cluster_collection_spec.rb
|
285
|
+
- spec/big_brother/cluster_factory_spec.rb
|
278
286
|
- spec/big_brother/cluster_spec.rb
|
279
287
|
- spec/big_brother/configuration_spec.rb
|
280
288
|
- spec/big_brother/health_fetcher_spec.rb
|
@@ -307,27 +315,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
307
315
|
- - ! '>='
|
308
316
|
- !ruby/object:Gem::Version
|
309
317
|
version: '0'
|
310
|
-
segments:
|
311
|
-
- 0
|
312
|
-
hash: 581258049934158314
|
313
318
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
319
|
none: false
|
315
320
|
requirements:
|
316
321
|
- - ! '>='
|
317
322
|
- !ruby/object:Gem::Version
|
318
323
|
version: '0'
|
319
|
-
segments:
|
320
|
-
- 0
|
321
|
-
hash: 581258049934158314
|
322
324
|
requirements: []
|
323
325
|
rubyforge_project:
|
324
|
-
rubygems_version: 1.8.
|
326
|
+
rubygems_version: 1.8.23
|
325
327
|
signing_key:
|
326
328
|
specification_version: 3
|
327
329
|
summary: Process to monitor and update weights for servers in an IPVS pool
|
328
330
|
test_files:
|
331
|
+
- spec/big_brother/active_active_cluster_spec.rb
|
332
|
+
- spec/big_brother/active_passive_cluster_spec.rb
|
329
333
|
- spec/big_brother/app_spec.rb
|
330
334
|
- spec/big_brother/cluster_collection_spec.rb
|
335
|
+
- spec/big_brother/cluster_factory_spec.rb
|
331
336
|
- spec/big_brother/cluster_spec.rb
|
332
337
|
- spec/big_brother/configuration_spec.rb
|
333
338
|
- spec/big_brother/health_fetcher_spec.rb
|