fluent-plugin-secure-forward 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36c52311efac9f5299e788cd59528b6b219235e1
4
- data.tar.gz: 9bb3d35a955fb318be671af1a56699deb2ba48fc
3
+ metadata.gz: b7537e28e4132ab67a0c349d00c5d9cc6b8ceec9
4
+ data.tar.gz: 0bee32d156d2790eab7f7b6ecc68dc6f140acd05
5
5
  SHA512:
6
- metadata.gz: 698ac45cf88865ba4246be9bd7bba7d61bf09f604f637874a9c012b861a6d42ae1b04c5d4fe365f08c3ca2175b1e6cae231ca19cd96b9af799604ed4ae22d088
7
- data.tar.gz: a455211d078fd04730d4d7422c538f3fde4e7da8f39915580905a359c71fc3ba0b7a15090f73e840e374efd7612443cd998aeab0b7028ab098601c7a24cf6d3e
6
+ metadata.gz: 718b3c7931428afca8784c41e572e7260108e8ab51ddf224b4bf2648031b00ac498ee2f2e7a6468d057f5c04047cd2752c96606b5dafab43e5a250af4c88a389
7
+ data.tar.gz: 6894e962c4baf8eb3f1de6dc26aa0fbc2c199f91b3905dca998dce6c56c6f69548a3cc60c62eb55350a8eba8a1987ec926335aa8a8b3c34dbe0f5211780f18ab
data/README.md CHANGED
@@ -124,7 +124,7 @@ Minimal configurations like this:
124
124
  </server>
125
125
  </match>
126
126
 
127
- When specified 2 or more `<server>`, this plugin uses these nodes in simple round-robin order.
127
+ When specified 2 or more `<server>`, this plugin uses these nodes in simple round-robin order. And servers with `standby yes` will be selected until all of non-standby servers goes down.
128
128
 
129
129
  If server requires username/password, set `username` and `password` in `<server>` section:
130
130
 
@@ -142,6 +142,12 @@ If server requires username/password, set `username` and `password` in `<server>
142
142
  username sasatatsu
143
143
  password karaage
144
144
  </server>
145
+ <server>
146
+ host standby.fqdn.local
147
+ username kzk
148
+ password hawaii
149
+ standby yes
150
+ </server>
145
151
  </match>
146
152
 
147
153
  To specify keepalive timeouts, use `keepalive` configuration with seconds. SSL connection will be disconnected and re-connected for each 1 hour with configuration below. In Default (and with `keepalive 0`), connections will not be disconnected without any communication troubles. (This feature is for dns name updates, and SSL common key refreshing.)
data/example/client.conf CHANGED
@@ -9,12 +9,14 @@
9
9
  keepalive 30
10
10
  <server>
11
11
  host localhost
12
+ standby
12
13
  </server>
13
14
  <server>
14
15
  host localhost
16
+ standby yes
15
17
  </server>
16
18
  <server>
17
- host localhost
19
+ host localhost2
18
20
  </server>
19
21
  flush_interval 1s
20
22
  </match>
@@ -1,11 +1,11 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-secure-forward"
4
- gem.version = "0.1.0"
4
+ gem.version = "0.1.1"
5
5
  gem.authors = ["TAGOMORI Satoshi"]
6
6
  gem.email = ["tagomoris@gmail.com"]
7
7
  gem.summary = %q{Fluentd input/output plugin to forward over SSL with authentications}
8
- gem.description = %q{This version is HIGHLY EXPERIMENTAL.}
8
+ gem.description = %q{Testing version}
9
9
  gem.homepage = "https://github.com/tagomoris/fluent-plugin-secure-forward"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
@@ -92,7 +92,7 @@ module Fluent
92
92
  true
93
93
  end
94
94
 
95
- def select_node
95
+ def select_node(permit_standby=false)
96
96
  tries = 0
97
97
  nodes = @nodes.size
98
98
  @mutex.synchronize {
@@ -102,7 +102,7 @@ module Fluent
102
102
  @next_node += 1
103
103
  @next_node = 0 if @next_node >= nodes
104
104
 
105
- return n if n && n.established?
105
+ return n if n && n.established? && (!n.standby || permit_standby)
106
106
 
107
107
  tries += 1
108
108
  end
@@ -164,10 +164,11 @@ module Fluent
164
164
 
165
165
  def write_objects(tag, es)
166
166
  #TODO: check errors
167
- node = select_node
167
+ node = select_node || select_node(true)
168
168
  unless node
169
169
  raise "no one nodes with valid ssl session"
170
170
  end
171
+ $log.trace "selected node", :host => node.host, :port => node.port, :standby => node.standby
171
172
 
172
173
  begin
173
174
  send_data(node, tag, es)
@@ -7,7 +7,8 @@
7
7
  require_relative 'openssl_util'
8
8
 
9
9
  class Fluent::SecureForwardOutput::Node
10
- attr_accessor :host, :port, :hostlabel, :shared_key, :username, :password
10
+ attr_accessor :host, :port, :hostlabel, :shared_key, :username, :password, :standby
11
+
11
12
  attr_accessor :authentication, :keepalive
12
13
  attr_accessor :socket, :sslsession, :unpacker, :shared_key_salt, :state
13
14
 
@@ -24,6 +25,7 @@ class Fluent::SecureForwardOutput::Node
24
25
  @hostlabel = conf['hostlabel'] || conf['host']
25
26
  @username = conf['username'] || ''
26
27
  @password = conf['password'] || ''
28
+ @standby = conf.has_key?('standby') && Fluent::Config.bool_value(conf['standby']) != false
27
29
 
28
30
  @authentication = nil
29
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-secure-forward
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: This version is HIGHLY EXPERIMENTAL.
69
+ description: Testing version
70
70
  email:
71
71
  - tagomoris@gmail.com
72
72
  executables: []