syncwrap 2.6.2 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/History.rdoc +44 -0
  3. data/Manifest.txt +2 -0
  4. data/README.rdoc +3 -3
  5. data/bin/syncwrap +1 -1
  6. data/lib/syncwrap/amazon_ec2.rb +1 -1
  7. data/lib/syncwrap/amazon_ws.rb +51 -17
  8. data/lib/syncwrap/base.rb +2 -2
  9. data/lib/syncwrap/cli.rb +1 -1
  10. data/lib/syncwrap/component.rb +6 -1
  11. data/lib/syncwrap/components/amazon_linux.rb +1 -1
  12. data/lib/syncwrap/components/arch.rb +48 -5
  13. data/lib/syncwrap/components/bundle.rb +1 -1
  14. data/lib/syncwrap/components/bundled_iyyov_daemon.rb +1 -1
  15. data/lib/syncwrap/components/bundler_gem.rb +1 -1
  16. data/lib/syncwrap/components/centos.rb +1 -1
  17. data/lib/syncwrap/components/commercial_jdk.rb +2 -1
  18. data/lib/syncwrap/components/cruby_vm.rb +15 -11
  19. data/lib/syncwrap/components/debian.rb +46 -10
  20. data/lib/syncwrap/components/etc_hosts.rb +1 -1
  21. data/lib/syncwrap/components/geminabox.rb +1 -1
  22. data/lib/syncwrap/components/hashdot.rb +2 -2
  23. data/lib/syncwrap/components/iyyov.rb +1 -1
  24. data/lib/syncwrap/components/iyyov_daemon.rb +1 -1
  25. data/lib/syncwrap/components/jruby_vm.rb +13 -7
  26. data/lib/syncwrap/components/lvm_cache.rb +1 -1
  27. data/lib/syncwrap/components/mdraid.rb +1 -1
  28. data/lib/syncwrap/components/network.rb +1 -1
  29. data/lib/syncwrap/components/open_jdk.rb +1 -1
  30. data/lib/syncwrap/components/postgresql.rb +24 -4
  31. data/lib/syncwrap/components/puma.rb +1 -1
  32. data/lib/syncwrap/components/qpid.rb +1 -1
  33. data/lib/syncwrap/components/rake_gem.rb +1 -1
  34. data/lib/syncwrap/components/rhel.rb +38 -17
  35. data/lib/syncwrap/components/run_user.rb +1 -1
  36. data/lib/syncwrap/components/source_tree.rb +1 -1
  37. data/lib/syncwrap/components/tarpit_gem.rb +1 -1
  38. data/lib/syncwrap/components/ubuntu.rb +1 -1
  39. data/lib/syncwrap/components/users.rb +10 -1
  40. data/lib/syncwrap/context.rb +11 -1
  41. data/lib/syncwrap/distro.rb +10 -5
  42. data/lib/syncwrap/formatter.rb +1 -1
  43. data/lib/syncwrap/git_help.rb +1 -1
  44. data/lib/syncwrap/hash_support.rb +1 -1
  45. data/lib/syncwrap/host.rb +1 -1
  46. data/lib/syncwrap/main.rb +1 -1
  47. data/lib/syncwrap/path_util.rb +1 -1
  48. data/lib/syncwrap/rsync.rb +8 -17
  49. data/lib/syncwrap/ruby_support.rb +1 -1
  50. data/lib/syncwrap/shell.rb +1 -1
  51. data/lib/syncwrap/systemd.rb +1 -1
  52. data/lib/syncwrap/user_data.rb +1 -1
  53. data/lib/syncwrap/version_support.rb +1 -1
  54. data/lib/syncwrap/zone_balancer.rb +65 -0
  55. data/lib/syncwrap.rb +19 -6
  56. data/sync/postgresql/postgresql.conf.erb +27 -5
  57. data/test/setup.rb +1 -1
  58. data/test/test_components.rb +3 -1
  59. data/test/test_context.rb +1 -1
  60. data/test/test_context_rput.rb +1 -1
  61. data/test/test_rsync.rb +1 -1
  62. data/test/test_shell.rb +1 -1
  63. data/test/test_space.rb +1 -1
  64. data/test/test_space_main.rb +9 -2
  65. data/test/test_version_support.rb +1 -1
  66. data/test/test_zone_balancer.rb +48 -0
  67. metadata +4 -2
@@ -105,13 +105,13 @@ max_connections = 100 # (change requires restart)
105
105
  # (change requires restart)
106
106
  #ssl_prefer_server_ciphers = on # (change requires restart) (9.4+)
107
107
  #ssl_ecdh_curve = 'prime256v1' # (change requires restart) (9.4+)
108
- #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
109
108
  #ssl_cert_file = 'server.crt' # (change requires restart)
110
109
  #ssl_key_file = 'server.key' # (change requires restart)
111
110
  #ssl_ca_file = '' # (change requires restart)
112
111
  #ssl_crl_file = '' # (change requires restart)
113
112
  #password_encryption = on
114
113
  #db_user_namespace = off
114
+ #row_security = on # (9.5+)
115
115
 
116
116
  # GSSAPI using Kerberos
117
117
  #krb_server_keyfile = ''
@@ -204,6 +204,7 @@ synchronous_commit = <%= synchronous_commit %> # synchronization level;
204
204
  # fsync_writethrough
205
205
  # open_sync
206
206
  #full_page_writes = on # recover from partial page writes
207
+ #wal_compression = off # enable compression of full-page writes (9.5+)
207
208
  #wal_log_hints = off # also do full page writes of non-critical updates
208
209
  # (change requires restart) (9.4+)
209
210
  #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
@@ -214,15 +215,23 @@ commit_delay = <%= commit_delay %> # range 0-100000, in microseconds
214
215
  #commit_siblings = 5 # range 1-1000
215
216
 
216
217
  # - Checkpoints -
217
-
218
+ <% if version_gte?(pg_version, [9,5]) %>
219
+ min_wal_size = <%= min_wal_size %> # (9.5+)
220
+ <% if max_wal_size %>
221
+ max_wal_size = <%= max_wal_size %> # (9.5+)
222
+ <% else %>
223
+ #max_wal_size = 1GB # (9.5+)
224
+ <% end %>
225
+ <% else %>
218
226
  checkpoint_segments = <%= checkpoint_segments %> # in logfile segments, min 1, 16MB each
227
+ <% end %>
219
228
  #checkpoint_timeout = 5min # range 30s-1h
220
229
  #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
221
230
  #checkpoint_warning = 30s # 0 disables
222
231
 
223
232
  # - Archiving -
224
233
 
225
- #archive_mode = off # allows archiving to be done
234
+ #archive_mode = off # enables archiving; off, on, (or 'always', 9.5+)
226
235
  # (change requires restart)
227
236
  #archive_command = '' # command to use to archive a logfile segment
228
237
  # placeholders: %p = path of file to archive
@@ -246,6 +255,8 @@ checkpoint_segments = <%= checkpoint_segments %> # in logfile segments, min 1, 1
246
255
  #wal_sender_timeout = 60s # in milliseconds; 0 disables (9.3+)
247
256
  #max_replication_slots = 0 # max number of replication slots
248
257
  # (change requires restart) (9.4+)
258
+ #track_commit_timestamp = off # collect timestamp of transaction commit
259
+ # (change requires restart) (9.5+)
249
260
 
250
261
  # - Master Server -
251
262
 
@@ -275,6 +286,8 @@ checkpoint_segments = <%= checkpoint_segments %> # in logfile segments, min 1, 1
275
286
  #wal_receiver_timeout = 60s # time that receiver waits for
276
287
  # communication from master
277
288
  # in milliseconds; 0 disables
289
+ #wal_retrieve_retry_interval = 5s # time to wait before retrying to
290
+ # retrieve WAL after a failed attempt (9.5+)
278
291
 
279
292
  #------------------------------------------------------------------------------
280
293
  # QUERY TUNING
@@ -447,11 +460,18 @@ log_line_prefix = '< %m >' # special values:
447
460
  # e.g. '<%u%%%d> '
448
461
  #log_lock_waits = off # log lock waits >= deadlock_timeout
449
462
  #log_statement = 'none' # none, ddl, mod, all
463
+ #log_replication_commands = off # (9.5+)
450
464
  #log_temp_files = -1 # log temporary files equal or larger
451
465
  # than the specified size in kilobytes;
452
466
  # -1 disables, 0 logs all temp files
453
467
  log_timezone = 'UTC'
454
468
 
469
+ # - Process Title -
470
+
471
+ #cluster_name = '' # added to process titles if nonempty
472
+ # (change requires restart) (9.5+)
473
+ #update_process_title = on
474
+
455
475
  #------------------------------------------------------------------------------
456
476
  # RUNTIME STATISTICS
457
477
  #------------------------------------------------------------------------------
@@ -463,7 +483,6 @@ log_timezone = 'UTC'
463
483
  #track_io_timing = off
464
484
  #track_functions = none # none, pl, all
465
485
  #track_activity_query_size = 1024 # (change requires restart)
466
- #update_process_title = on
467
486
  #stats_temp_directory = 'pg_stat_tmp'
468
487
 
469
488
  # - Statistics Monitoring -
@@ -510,7 +529,7 @@ log_timezone = 'UTC'
510
529
 
511
530
  # - Statement Behavior -
512
531
 
513
- #search_path = '"$user",public' # schema names
532
+ #search_path = '"$user", public' # schema names
514
533
  #default_tablespace = '' # a tablespace name, '' uses the default
515
534
  #temp_tablespaces = '' # a list of tablespace names, '' uses
516
535
  # only default tablespace
@@ -528,6 +547,8 @@ log_timezone = 'UTC'
528
547
  #bytea_output = 'hex' # hex, escape
529
548
  #xmlbinary = 'base64'
530
549
  #xmloption = 'content'
550
+ #gin_fuzzy_search_limit = 0 # (9.4+?)
551
+ #gin_pending_list_limit = 4MB # (9.5+)
531
552
 
532
553
  # - Locale and Formatting -
533
554
 
@@ -585,6 +606,7 @@ default_text_search_config = 'pg_catalog.english'
585
606
  #default_with_oids = off
586
607
  #escape_string_warning = on
587
608
  #lo_compat_privileges = off
609
+ #operator_precedence_warning = off # (9.5+)
588
610
  #quote_all_identifiers = off
589
611
  #sql_inheritance = on
590
612
  #standard_conforming_strings = on
data/test/setup.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -35,6 +35,7 @@ module SyncWrap
35
35
  [ Debian ],
36
36
  [ Debian, CRubyVM ],
37
37
  [ CentOS, CRubyVM ],
38
+ [ Arch, CRubyVM ],
38
39
  [ EtcHosts ],
39
40
  [ AmazonLinux, JRubyVM, RunUser, Iyyov, Geminabox ],
40
41
  [ RHEL, JRubyVM, BundlerGem ],
@@ -76,6 +77,7 @@ module SyncWrap
76
77
  [ Debian, PostgreSQL ],
77
78
  [ Ubuntu, PostgreSQL ],
78
79
  [ CentOS, PostgreSQL ],
80
+ [ CentOS, PostgreSQL, pg_version: '9.5' ],
79
81
  [ RHEL, Qpid ],
80
82
  [ CentOS, QpidRepo, qpid_prebuild_repo: 'http://localhost' ],
81
83
  [ RHEL ],
data/test/test_context.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
data/test/test_rsync.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
data/test/test_shell.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
data/test/test_space.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -20,9 +20,11 @@
20
20
  require_relative 'setup'
21
21
 
22
22
  require 'syncwrap'
23
+ require 'syncwrap/version_support.rb'
23
24
 
24
25
  class TestSpaceMain < MiniTest::Unit::TestCase
25
26
  include SyncWrap
27
+ include VersionSupport
26
28
 
27
29
  def setup
28
30
  @sp = Space.new
@@ -34,7 +36,12 @@ class TestSpaceMain < MiniTest::Unit::TestCase
34
36
  end
35
37
 
36
38
  def test
37
- skip if defined?( JRUBY_VERSION ) # 1.6.8, 1.7.10-12 fail this test
39
+ skip if ( defined?( JRUBY_VERSION ) &&
40
+ ( version_lt?( JRUBY_VERSION, [1,7,24] ) ||
41
+ ( version_gte?( JRUBY_VERSION, [9] ) &&
42
+ version_lt?( JRUBY_VERSION, [9,0,5] ) ) ) )
43
+ # JRuby 1.6.x, 1.7.[0-23], 9.0.[0-4] all fail this test
44
+ # See also Space#wrap_sync_load?
38
45
  assert( @sp.execute( @sp.hosts, [ [IyyovDaemon, :daemon_service_dir] ] ) )
39
46
  end
40
47
  end
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2011-2015 David Kellum
5
+ # Copyright (c) 2011-2016 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env jruby
2
+ #.hashdot.profile += jruby-shortlived
3
+
4
+ #--
5
+ # Copyright (c) 2011-2016 David Kellum
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
8
+ # may not use this file except in compliance with the License. You
9
+ # may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16
+ # implied. See the License for the specific language governing
17
+ # permissions and limitations under the License.
18
+ #++
19
+
20
+ require_relative 'setup'
21
+
22
+ require 'syncwrap'
23
+
24
+ class TestZoneBalancer < MiniTest::Unit::TestCase
25
+ include SyncWrap
26
+
27
+ def test
28
+ sp = Space.new
29
+ zb = ZoneBalancer
30
+ sp.with do
31
+ f = zb.zone( %w[a b c], [:r2] )
32
+ assert_equal( 'a', f.call )
33
+
34
+ sp.host( 'h1', :r1, :r2, availability_zone: 'a' )
35
+ sp.host( 'h2', :r2, availability_zone: 'b' )
36
+ sp.host( 'h3', :r2, availability_zone: 'a' )
37
+ sp.host( 'h4', :r3, availability_zone: 'b' )
38
+
39
+ assert_equal( 'c', f.call )
40
+ assert_equal( 'c', zb.next_zone( sp, %w[a b c], [:r2] ) )
41
+ assert_equal( 'b', zb.next_zone( sp, %w[a b], [:r2] ) )
42
+ assert_equal( 'b', zb.next_zone( sp, %w[a b c], [:r1] ) )
43
+ assert_equal( 'a', zb.next_zone( sp, %w[a b c], [:rempty] ) )
44
+ assert_equal( 'c', zb.next_zone( sp, %w[a b c] ) )
45
+
46
+ end
47
+ end
48
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncwrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -214,6 +214,7 @@ files:
214
214
  - lib/syncwrap/systemd.rb
215
215
  - lib/syncwrap/user_data.rb
216
216
  - lib/syncwrap/version_support.rb
217
+ - lib/syncwrap/zone_balancer.rb
217
218
  - sync/etc/corosync/corosync.conf
218
219
  - sync/etc/corosync/uidgid.d/qpid
219
220
  - sync/etc/gemrc
@@ -256,6 +257,7 @@ files:
256
257
  - test/test_space.rb
257
258
  - test/test_space_main.rb
258
259
  - test/test_version_support.rb
260
+ - test/test_zone_balancer.rb
259
261
  - test/zfile
260
262
  homepage: http://github.com/dekellum/syncwrap
261
263
  licenses: []