syncwrap 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,17 @@
1
+ === 1.3.0 (2012-10-4)
2
+ * Include RHEL/Amazon Linux Postgresql 9.1 config and deploy support
3
+ and reorganize for Ubuntu support as well. Default deploy data dir
4
+ is now /pg/data which makes sense for an EBS mount. Config is
5
+ further tuned for EBS. PostgreSQL::EC2 has been dropped.
6
+ PostgreSQL::RHEL and PostgreSQL::Ubuntu are auto-included with
7
+ PostgreSQL module if RHEL or Ubuntu is included.
8
+ * For performance on relatively slow virtual hosts, only check
9
+ iyyov_install if iyyov_install_jobs( :install => true )
10
+ * Add generic etc/gemrc and jruby_install_gemrc (incl in jruby_install)
11
+ * Include jstat in list of java command symlinks with java_install
12
+ * EC2.ec2_reformat_mnt_as_ext is for ephemoral not EBS, rename
13
+ attribute to ec2_es_device
14
+
1
15
  === 1.2.1 (2012-9-25)
2
16
  * Build hashdot with java 1.7.0_07 as well
3
17
  * Fix lib jruby link on update: --no-dereference
data/Manifest.txt CHANGED
@@ -2,13 +2,9 @@ History.rdoc
2
2
  Manifest.txt
3
3
  README.rdoc
4
4
  Rakefile
5
+ etc/gemrc
5
6
  etc/init.d/iyyov
6
- etc/postgresql/9.1/main/environment
7
- etc/postgresql/9.1/main/pg_ctl.conf
8
- etc/postgresql/9.1/main/pg_hba.conf
9
- etc/postgresql/9.1/main/pg_ident.conf
10
- etc/postgresql/9.1/main/postgresql.conf
11
- etc/postgresql/9.1/main/start.conf
7
+ etc/sysconfig/pgsql/postgresql
12
8
  etc/sysctl.d/61-postgresql-shm.conf
13
9
  lib/syncwrap/base.rb
14
10
  lib/syncwrap.rb
@@ -25,6 +21,15 @@ lib/syncwrap/remote_task.rb
25
21
  lib/syncwrap/rhel.rb
26
22
  lib/syncwrap/ubuntu.rb
27
23
  lib/syncwrap/user_run.rb
24
+ postgresql/rhel/pg_hba.conf
25
+ postgresql/rhel/pg_ident.conf
26
+ postgresql/rhel/postgresql.conf
27
+ postgresql/ubuntu/environment
28
+ postgresql/ubuntu/pg_ctl.conf
29
+ postgresql/ubuntu/pg_hba.conf
30
+ postgresql/ubuntu/pg_ident.conf
31
+ postgresql/ubuntu/postgresql.conf
32
+ postgresql/ubuntu/start.conf
28
33
  test/test_syncwrap.rb
29
34
  usr/local/bin/jgem
30
35
  var/iyyov/jobs.rb
data/Rakefile CHANGED
@@ -60,8 +60,6 @@ class SyncWrapper
60
60
  desc "Deploy PostgreSQL"
61
61
  remote_task :pg_deploy do
62
62
  pg_install
63
- pg_stop
64
- pg_adjust_sysctl
65
63
  pg_configure
66
64
  pg_start
67
65
  end
data/etc/gemrc ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ install: --no-ri --no-rdoc
3
+ update: --no-ri --no-rdoc
4
+ :backtrace: false
5
+ :benchmark: false
6
+ :bulk_threshold: 1000
7
+ :verbose: true
8
+ :update_sources: true
9
+ :sources:
10
+ - http://rubygems.org/
11
+ ...
@@ -0,0 +1,2 @@
1
+ # Default
2
+ PGDATA=/pg/data
data/lib/syncwrap/base.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  #++
16
16
 
17
17
  module SyncWrap
18
- VERSION='1.2.1'
18
+ VERSION='1.3.0'
19
19
  end
data/lib/syncwrap/ec2.rb CHANGED
@@ -20,27 +20,27 @@ require 'syncwrap/common'
20
20
  module SyncWrap::EC2
21
21
  include SyncWrap::Common
22
22
 
23
- # The device name of the EBS device mounted on /mnt
23
+ # The device name of the ephemeral storage device
24
24
  # (default: 'xvdb')
25
- attr_accessor :ec2_ebs_mnt_device
25
+ attr_accessor :ec2_es_device
26
26
 
27
27
  def initialize
28
28
  super
29
29
 
30
- @ec2_ebs_mnt_device = 'xvdb'
30
+ @ec2_es_device = 'xvdb'
31
31
  end
32
32
 
33
33
  # WARNING: Destructive if run!
34
- # Re-mkfs /mnt partition as ext4 if its ec2_ebs_mnt_device and is
34
+ # Re-mkfs /mnt partition as ext4 if its ec2_es_device and is
35
35
  # currently ext3
36
36
  def ec2_reformat_mnt_as_ext4
37
37
  rc = exec_conditional do
38
- run "mount | grep '/dev/#{ec2_ebs_mnt_device} on /mnt'"
38
+ run "mount | grep '/dev/#{ec2_es_device} on /mnt'"
39
39
  end
40
- raise "Device /dev/#{ec2_ebs_mnt_device} not mounted on /mnt" unless rc == 0
40
+ raise "Device /dev/#{ec2_es_device} not mounted on /mnt" unless rc == 0
41
41
 
42
42
  rc = exec_conditional do
43
- run "mount | grep '/dev/#{ec2_ebs_mnt_device} on /mnt type ext3'"
43
+ run "mount | grep '/dev/#{ec2_es_device} on /mnt type ext3'"
44
44
  end
45
45
  ec2_reformat_mnt_as_ext4! if rc == 0
46
46
  end
@@ -51,7 +51,7 @@ module SyncWrap::EC2
51
51
  def ec2_reformat_mnt_as_ext4!
52
52
  sudo <<-SH
53
53
  umount /mnt
54
- mkfs -t ext4 /dev/#{ec2_ebs_mnt_device}
54
+ mkfs -t ext4 /dev/#{ec2_es_device}
55
55
  mount /mnt
56
56
  SH
57
57
  end
@@ -37,14 +37,17 @@ module SyncWrap::Iyyov
37
37
  # for daemon gem or other setup, then finally update remote
38
38
  # (user_run) var/iyyov/jobs.rb; which will trigger any necessary
39
39
  # restarts.
40
- def iyyov_install_jobs
40
+ # === Options
41
+ # :install:: If true, run iyyov_install first and make sure iyyov is
42
+ # running (default: false)
43
+ def iyyov_install_jobs( opts = {} )
41
44
  user_run_dir_setup
42
45
 
43
- restart = iyyov_install
46
+ restart = opts[ :install ] && iyyov_install
44
47
  if restart
45
48
  iyyov_restart
46
49
  sleep 15
47
- elsif !exist?( "#{iyyov_run_dir}/iyyov.pid" )
50
+ elsif opts[ :install ] && !exist?( "#{iyyov_run_dir}/iyyov.pid" )
48
51
  iyyov_start
49
52
  sleep 15
50
53
  end
data/lib/syncwrap/java.rb CHANGED
@@ -47,7 +47,7 @@ module SyncWrap::Java
47
47
  end
48
48
 
49
49
  def java_install!
50
- bins = %w[ java jmap jstack jps jinfo jhat javac ].
50
+ bins = %w[ java jmap jstack jstat jps jinfo jhat javac ].
51
51
  map { |b| "../lib/java/bin/#{b}" }.
52
52
  join( ' ' )
53
53
 
@@ -38,11 +38,22 @@ module SyncWrap::JRuby
38
38
  @jruby_gem_install_args = %w[ --no-rdoc --no-ri ]
39
39
  end
40
40
 
41
+ def jruby_gemrc_path
42
+ "#{common_prefix}/lib/jruby/jruby-#{jruby_version}/etc"
43
+ end
44
+
41
45
  # Install jruby if the jruby_version is not already present.
42
46
  def jruby_install
43
47
  unless exist?( "#{common_prefix}/lib/jruby/jruby-#{jruby_version}" )
44
48
  jruby_install!
45
49
  end
50
+ jruby_install_gemrc
51
+ end
52
+
53
+ # Install gemrc file to jruby_gemrc_path
54
+ def jruby_install_gemrc
55
+ sudo "mkdir -p #{jruby_gemrc_path}"
56
+ rput( 'etc/gemrc', jruby_gemrc_path, :user => 'root' )
46
57
  end
47
58
 
48
59
  # Install jruby, including usr/local/bin local contents
@@ -15,24 +15,43 @@
15
15
  #++
16
16
 
17
17
  require 'syncwrap/distro'
18
+ require 'syncwrap/ubuntu'
19
+ require 'syncwrap/rhel'
18
20
 
19
21
  # Provisions for install and configuration of PostgreSQL
20
22
  module SyncWrap::PostgreSQL
21
23
  include SyncWrap::Distro
22
24
 
25
+ # Location of postgresql data dir (databases + config in default
26
+ # case)
27
+ attr_accessor :pg_data_dir
28
+
29
+ # The stock distribution default data_dir. Difference with
30
+ # pg_data_dir triggers additional install steps.
31
+ attr_accessor :pg_default_data_dir
32
+
33
+ # Local directory for configuration files (different by
34
+ # distribution)
35
+ attr_accessor :pg_deploy_config
36
+
23
37
  def initialize
24
38
  super
39
+ @pg_data_dir = '/pg/data'
25
40
  end
26
41
 
27
- # Update PostgreSQL config files from local etc
28
- def pg_configure
29
- rput( 'etc/postgresql/9.1/main/', :user => 'postgres' )
42
+ def pg_config_dir
43
+ @pg_data_dir
30
44
  end
31
45
 
32
46
  def pg_install
33
47
  dist_install 'postgresql'
34
48
  end
35
49
 
50
+ # Update PostgreSQL config files
51
+ def pg_configure
52
+ rput( "#{pg_deploy_config}/", pg_config_dir, :user => 'postgres' )
53
+ end
54
+
36
55
  def pg_start
37
56
  dist_service( 'postgresql', 'start' )
38
57
  end
@@ -41,32 +60,72 @@ module SyncWrap::PostgreSQL
41
60
  dist_service( 'postgresql', 'stop' )
42
61
  end
43
62
 
44
- def pg_adjust_sysctl
45
- rput( 'etc/sysctl.d/61-postgresql-shm.conf', :user => 'root' )
46
- sudo "sysctl -p /etc/sysctl.d/61-postgresql-shm.conf"
63
+ def self.included( base )
64
+ if base.include?( SyncWrap::RHEL )
65
+ base.send( :include, SyncWrap::PostgreSQL::RHEL )
66
+ elsif base.include?( SyncWrap::Ubuntu )
67
+ base.send( :include, SyncWrap::PostgreSQL::Ubuntu )
68
+ end
47
69
  end
48
70
 
49
- module Ubuntu
50
- include SyncWrap::PostgreSQL
71
+ module RHEL
51
72
 
52
73
  def initialize
53
74
  super
75
+ #Per Amazon Linux 2012 3.3
76
+ @pg_default_data_dir = '/var/lib/pgsql9/data'
77
+ @pg_deploy_config = 'postgresql/rhel'
78
+ end
79
+
80
+ def pg_install
81
+ super
82
+ unless @pg_data_dir == @pg_default_data_dir
83
+ # (Per Amazon Linux)
84
+ # Install PGDATA var override for init.d/postgresql
85
+ rput( 'etc/sysconfig/pgsql/postgresql', :user => 'root' )
86
+ sudo <<-SH
87
+ mkdir -p #{pg_data_dir}
88
+ chown postgres:postgres #{pg_data_dir}
89
+ chmod 700 #{pg_data_dir}
90
+ SH
91
+ end
92
+ dist_service( 'postgresql', 'initdb' )
54
93
  end
55
94
 
56
95
  end
57
96
 
58
- module EC2
59
- include SyncWrap::PostgreSQL
97
+ module Ubuntu
60
98
 
61
99
  def initialize
62
100
  super
101
+ @pg_default_data_dir = '/var/lib/postgresql/9.1/main'
102
+ @pg_deploy_config = 'postgresql/ubuntu'
103
+ end
104
+
105
+ def pg_install
106
+ super
107
+ pg_stop #Ubuntu does a start
108
+ pg_adjust_sysctl
109
+ pg_relocate unless @pg_data_dir == @pg_default_data_dir
110
+ end
111
+
112
+ def pg_config_dir
113
+ "/etc/postgresql/9.1/main"
114
+ end
115
+
116
+ def pg_adjust_sysctl
117
+ rput( 'etc/sysctl.d/61-postgresql-shm.conf', :user => 'root' )
118
+ sudo "sysctl -p /etc/sysctl.d/61-postgresql-shm.conf"
63
119
  end
64
120
 
121
+ # Move the data dir into its final location, since on Ubuntu the
122
+ # package install does the initdb step
65
123
  def pg_relocate
66
- # FIXME: Different default location on RHEL?
67
124
  sudo <<-SH
68
- mkdir -p /mnt/var/postgresql/
69
- mv /var/lib/postgresql/9.1 /mnt/var/postgresql/
125
+ mkdir -p #{pg_data_dir}
126
+ chown postgres:postgres #{pg_data_dir}
127
+ chmod 700 #{pg_data_dir}
128
+ mv #{pg_default_data_dir}/* #{pg_data_dir}/
70
129
  SH
71
130
  end
72
131
 
data/lib/syncwrap/rhel.rb CHANGED
@@ -29,11 +29,6 @@ module SyncWrap::RHEL
29
29
  'postgresql' => 'postgresql-server' )
30
30
  end
31
31
 
32
- # FIXME
33
- # rpm -Uvh \
34
- # http://linux.mirrors.es.net/fedora-epel/6/x86_64/ \
35
- # epel-release-6-7.noarch.rpm
36
-
37
32
  def dist_install( *pkgs )
38
33
  pkgs = dist_map_packages( pkgs )
39
34
  sudo "yum install -q -y #{pkgs.join( ' ' )}"
@@ -0,0 +1,87 @@
1
+ # PostgreSQL Client Authentication Configuration File
2
+ # ===================================================
3
+ #
4
+ # Refer to the "Client Authentication" section in the PostgreSQL
5
+ # documentation for a complete description of this file. A short
6
+ # synopsis follows.
7
+ #
8
+ # This file controls: which hosts are allowed to connect, how clients
9
+ # are authenticated, which PostgreSQL user names they can use, which
10
+ # databases they can access. Records take one of these forms:
11
+ #
12
+ # local DATABASE USER METHOD [OPTIONS]
13
+ # host DATABASE USER ADDRESS METHOD [OPTIONS]
14
+ # hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
15
+ # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
16
+ #
17
+ # (The uppercase items must be replaced by actual values.)
18
+ #
19
+ # The first field is the connection type: "local" is a Unix-domain
20
+ # socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
21
+ # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
22
+ # plain TCP/IP socket.
23
+ #
24
+ # DATABASE can be "all", "sameuser", "samerole", "replication", a
25
+ # database name, or a comma-separated list thereof. The "all"
26
+ # keyword does not match "replication". Access to replication
27
+ # must be enabled in a separate record (see example below).
28
+ #
29
+ # USER can be "all", a user name, a group name prefixed with "+", or a
30
+ # comma-separated list thereof. In both the DATABASE and USER fields
31
+ # you can also write a file name prefixed with "@" to include names
32
+ # from a separate file.
33
+ #
34
+ # ADDRESS specifies the set of hosts the record matches. It can be a
35
+ # host name, or it is made up of an IP address and a CIDR mask that is
36
+ # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
37
+ # specifies the number of significant bits in the mask. A host name
38
+ # that starts with a dot (.) matches a suffix of the actual host name.
39
+ # Alternatively, you can write an IP address and netmask in separate
40
+ # columns to specify the set of hosts. Instead of a CIDR-address, you
41
+ # can write "samehost" to match any of the server's own IP addresses,
42
+ # or "samenet" to match any address in any subnet that the server is
43
+ # directly connected to.
44
+ #
45
+ # METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
46
+ # "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
47
+ # "password" sends passwords in clear text; "md5" is preferred since
48
+ # it sends encrypted passwords.
49
+ #
50
+ # OPTIONS are a set of options for the authentication in the format
51
+ # NAME=VALUE. The available options depend on the different
52
+ # authentication methods -- refer to the "Client Authentication"
53
+ # section in the documentation for a list of which options are
54
+ # available for which authentication methods.
55
+ #
56
+ # Database and user names containing spaces, commas, quotes and other
57
+ # special characters must be quoted. Quoting one of the keywords
58
+ # "all", "sameuser", "samerole" or "replication" makes the name lose
59
+ # its special character, and just match a database or username with
60
+ # that name.
61
+ #
62
+ # This file is read on server startup and when the postmaster receives
63
+ # a SIGHUP signal. If you edit the file on a running system, you have
64
+ # to SIGHUP the postmaster for the changes to take effect. You can
65
+ # use "pg_ctl reload" to do that.
66
+
67
+ # Put your actual configuration here
68
+ # ----------------------------------
69
+ #
70
+ # If you want to allow non-local connections, you need to add more
71
+ # "host" records. In that case you will also need to make PostgreSQL
72
+ # listen on a non-local interface via the listen_addresses
73
+ # configuration parameter, or via the -i or -h command line switches.
74
+
75
+ # TYPE DATABASE USER ADDRESS METHOD
76
+
77
+ # "local" is for Unix domain socket connections only
78
+ local all all peer
79
+ # IPv4 local connections:
80
+ host all all 127.0.0.1/32 trust
81
+ # IPv6 local connections:
82
+ host all all ::1/128 trust
83
+ # Allow replication connections from localhost, by a user with the
84
+ # replication privilege.
85
+ #local replication postgres peer
86
+ #host replication postgres 127.0.0.1/32 ident
87
+ #host replication postgres ::1/128 ident
@@ -0,0 +1,540 @@
1
+ # -----------------------------
2
+ # PostgreSQL configuration file
3
+ # -----------------------------
4
+ #
5
+ # This file consists of lines of the form:
6
+ #
7
+ # name = value
8
+ #
9
+ # (The "=" is optional.) Whitespace may be used. Comments are introduced with
10
+ # "#" anywhere on a line. The complete list of parameter names and allowed
11
+ # values can be found in the PostgreSQL documentation.
12
+ #
13
+ # The commented-out settings shown in this file represent the default values.
14
+ # Re-commenting a setting is NOT sufficient to revert it to the default value;
15
+ # you need to reload the server.
16
+ #
17
+ # This file is read on server startup and when the server receives a SIGHUP
18
+ # signal. If you edit the file on a running system, you have to SIGHUP the
19
+ # server for the changes to take effect, or use "pg_ctl reload". Some
20
+ # parameters, which are marked below, require a server shutdown and restart to
21
+ # take effect.
22
+ #
23
+ # Any parameter can also be given as a command-line option to the server, e.g.,
24
+ # "postgres -c log_connections=on". Some parameters can be changed at run time
25
+ # with the "SET" SQL command.
26
+ #
27
+ # Memory units: kB = kilobytes Time units: ms = milliseconds
28
+ # MB = megabytes s = seconds
29
+ # GB = gigabytes min = minutes
30
+ # h = hours
31
+ # d = days
32
+
33
+ #------------------------------------------------------------------------------
34
+ # FILE LOCATIONS
35
+ #------------------------------------------------------------------------------
36
+
37
+ # The default values of these variables are driven from the -D command-line
38
+ # option or PGDATA environment variable, represented here as ConfigDir.
39
+
40
+ #data_directory = 'ConfigDir' # use data in another directory
41
+ # (change requires restart)
42
+ #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
43
+ # (change requires restart)
44
+ #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
45
+ # (change requires restart)
46
+
47
+ # If external_pid_file is not explicitly set, no extra PID file is written.
48
+ #external_pid_file = '(none)' # write an extra PID file
49
+ # (change requires restart)
50
+
51
+ #------------------------------------------------------------------------------
52
+ # CONNECTIONS AND AUTHENTICATION
53
+ #------------------------------------------------------------------------------
54
+
55
+ # - Connection Settings -
56
+
57
+ #listen_addresses = 'localhost' # what IP address(es) to listen on;
58
+ # comma-separated list of addresses;
59
+ # defaults to 'localhost', '*' = all
60
+ # (change requires restart)
61
+ #port = 5432 # (change requires restart)
62
+ max_connections = 100 # (change requires restart)
63
+ # Note: Increasing max_connections costs ~400 bytes of shared memory per
64
+ # connection slot, plus lock space (see max_locks_per_transaction).
65
+ #superuser_reserved_connections = 3 # (change requires restart)
66
+ #unix_socket_directory = '' # (change requires restart)
67
+ #unix_socket_group = '' # (change requires restart)
68
+ #unix_socket_permissions = 0777 # begin with 0 to use octal notation
69
+ # (change requires restart)
70
+ #bonjour = off # advertise server via Bonjour
71
+ # (change requires restart)
72
+ #bonjour_name = '' # defaults to the computer name
73
+ # (change requires restart)
74
+
75
+ # - Security and Authentication -
76
+
77
+ #authentication_timeout = 1min # 1s-600s
78
+ #ssl = off # (change requires restart)
79
+ #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
80
+ # (change requires restart)
81
+ #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
82
+ #password_encryption = on
83
+ #db_user_namespace = off
84
+
85
+ # Kerberos and GSSAPI
86
+ #krb_server_keyfile = ''
87
+ #krb_srvname = 'postgres' # (Kerberos only)
88
+ #krb_caseins_users = off
89
+
90
+ # - TCP Keepalives -
91
+ # see "man 7 tcp" for details
92
+
93
+ #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
94
+ # 0 selects the system default
95
+ #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
96
+ # 0 selects the system default
97
+ #tcp_keepalives_count = 0 # TCP_KEEPCNT;
98
+ # 0 selects the system default
99
+
100
+ #------------------------------------------------------------------------------
101
+ # RESOURCE USAGE (except WAL)
102
+ #------------------------------------------------------------------------------
103
+
104
+ # - Memory -
105
+
106
+ shared_buffers = 256MB # min 128kB
107
+ # (change requires restart)
108
+ #temp_buffers = 8MB # min 800kB
109
+ #max_prepared_transactions = 0 # zero disables the feature
110
+ # (change requires restart)
111
+ # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
112
+ # per transaction slot, plus lock space (see max_locks_per_transaction).
113
+ # It is not advisable to set max_prepared_transactions nonzero unless you
114
+ # actively intend to use prepared transactions.
115
+ work_mem = 128MB # min 64kB
116
+ maintenance_work_mem = 128MB # min 1MB
117
+ max_stack_depth = 4MB # min 100kB
118
+
119
+ # - Kernel Resource Usage -
120
+
121
+ #max_files_per_process = 1000 # min 25
122
+ # (change requires restart)
123
+ #shared_preload_libraries = '' # (change requires restart)
124
+
125
+ # - Cost-Based Vacuum Delay -
126
+
127
+ #vacuum_cost_delay = 0ms # 0-100 milliseconds
128
+ #vacuum_cost_page_hit = 1 # 0-10000 credits
129
+ #vacuum_cost_page_miss = 10 # 0-10000 credits
130
+ #vacuum_cost_page_dirty = 20 # 0-10000 credits
131
+ #vacuum_cost_limit = 200 # 1-10000 credits
132
+
133
+ # - Background Writer -
134
+
135
+ #bgwriter_delay = 200ms # 10-10000ms between rounds
136
+ #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
137
+ #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
138
+
139
+ # - Asynchronous Behavior -
140
+
141
+ effective_io_concurrency = 4 # 1-1000. 0 disables prefetching
142
+
143
+ #------------------------------------------------------------------------------
144
+ # WRITE AHEAD LOG
145
+ #------------------------------------------------------------------------------
146
+
147
+ # - Settings -
148
+
149
+ #wal_level = minimal # minimal, archive, or hot_standby
150
+ # (change requires restart)
151
+ #fsync = on # turns forced synchronization on or off
152
+ synchronous_commit = off # synchronization level; on, off, or local
153
+ #wal_sync_method = fsync # the default is the first option
154
+ # supported by the operating system:
155
+ # open_datasync
156
+ # fdatasync (default on Linux)
157
+ # fsync
158
+ # fsync_writethrough
159
+ # open_sync
160
+ #full_page_writes = on # recover from partial page writes
161
+ #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
162
+ # (change requires restart)
163
+ #wal_writer_delay = 200ms # 1-10000 milliseconds
164
+
165
+ commit_delay = 10000 # range 0-100000, in microseconds
166
+ #commit_siblings = 5 # range 1-1000
167
+
168
+ # - Checkpoints -
169
+
170
+ checkpoint_segments = 16 # in logfile segments, min 1, 16MB each
171
+ #checkpoint_timeout = 5min # range 30s-1h
172
+ #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
173
+ #checkpoint_warning = 30s # 0 disables
174
+
175
+ # - Archiving -
176
+
177
+ #archive_mode = off # allows archiving to be done
178
+ # (change requires restart)
179
+ #archive_command = '' # command to use to archive a logfile segment
180
+ #archive_timeout = 0 # force a logfile segment switch after this
181
+ # number of seconds; 0 disables
182
+
183
+ #------------------------------------------------------------------------------
184
+ # REPLICATION
185
+ #------------------------------------------------------------------------------
186
+
187
+ # - Master Server -
188
+
189
+ # These settings are ignored on a standby server
190
+
191
+ #max_wal_senders = 0 # max number of walsender processes
192
+ # (change requires restart)
193
+ #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
194
+ #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
195
+ #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
196
+ #replication_timeout = 60s # in milliseconds; 0 disables
197
+ #synchronous_standby_names = '' # standby servers that provide sync rep
198
+ # comma-separated list of application_name
199
+ # from standby(s); '*' = all
200
+
201
+ # - Standby Servers -
202
+
203
+ # These settings are ignored on a master server
204
+
205
+ #hot_standby = off # "on" allows queries during recovery
206
+ # (change requires restart)
207
+ #max_standby_archive_delay = 30s # max delay before canceling queries
208
+ # when reading WAL from archive;
209
+ # -1 allows indefinite delay
210
+ #max_standby_streaming_delay = 30s # max delay before canceling queries
211
+ # when reading streaming WAL;
212
+ # -1 allows indefinite delay
213
+ #wal_receiver_status_interval = 10s # send replies at least this often
214
+ # 0 disables
215
+ #hot_standby_feedback = off # send info from standby to prevent
216
+ # query conflicts
217
+
218
+ #------------------------------------------------------------------------------
219
+ # QUERY TUNING
220
+ #------------------------------------------------------------------------------
221
+
222
+ # - Planner Method Configuration -
223
+
224
+ #enable_bitmapscan = on
225
+ #enable_hashagg = on
226
+ #enable_hashjoin = on
227
+ #enable_indexscan = on
228
+ #enable_material = on
229
+ #enable_mergejoin = on
230
+ #enable_nestloop = on
231
+ #enable_seqscan = on
232
+ #enable_sort = on
233
+ #enable_tidscan = on
234
+
235
+ # - Planner Cost Constants -
236
+
237
+ #seq_page_cost = 1.0 # measured on an arbitrary scale
238
+ #random_page_cost = 4.0 # same scale as above
239
+ #cpu_tuple_cost = 0.01 # same scale as above
240
+ #cpu_index_tuple_cost = 0.005 # same scale as above
241
+ #cpu_operator_cost = 0.0025 # same scale as above
242
+ #effective_cache_size = 128MB
243
+
244
+ # - Genetic Query Optimizer -
245
+
246
+ #geqo = on
247
+ #geqo_threshold = 12
248
+ #geqo_effort = 5 # range 1-10
249
+ #geqo_pool_size = 0 # selects default based on effort
250
+ #geqo_generations = 0 # selects default based on effort
251
+ #geqo_selection_bias = 2.0 # range 1.5-2.0
252
+ #geqo_seed = 0.0 # range 0.0-1.0
253
+
254
+ # - Other Planner Options -
255
+
256
+ #default_statistics_target = 100 # range 1-10000
257
+ #constraint_exclusion = partition # on, off, or partition
258
+ #cursor_tuple_fraction = 0.1 # range 0.0-1.0
259
+ #from_collapse_limit = 8
260
+ #join_collapse_limit = 8 # 1 disables collapsing of explicit
261
+ # JOIN clauses
262
+
263
+ #------------------------------------------------------------------------------
264
+ # ERROR REPORTING AND LOGGING
265
+ #------------------------------------------------------------------------------
266
+
267
+ # - Where to Log -
268
+
269
+ #log_destination = 'stderr' # Valid values are combinations of
270
+ # stderr, csvlog, syslog, and eventlog,
271
+ # depending on platform. csvlog
272
+ # requires logging_collector to be on.
273
+
274
+ # This is used when logging to stderr:
275
+ logging_collector = on # Enable capturing of stderr and csvlog
276
+ # into log files. Required to be on for
277
+ # csvlogs.
278
+ # (change requires restart)
279
+
280
+ # These are only used if logging_collector is on:
281
+ #log_directory = 'pg_log' # directory where log files are written,
282
+ # can be absolute or relative to PGDATA
283
+ log_filename = 'postgresql-%a.log' # log file name pattern,
284
+ # can include strftime() escapes
285
+ #log_file_mode = 0600 # creation mode for log files,
286
+ # begin with 0 to use octal notation
287
+ log_truncate_on_rotation = on # If on, an existing log file with the
288
+ # same name as the new log file will be
289
+ # truncated rather than appended to.
290
+ # But such truncation only occurs on
291
+ # time-driven rotation, not on restarts
292
+ # or size-driven rotation. Default is
293
+ # off, meaning append to existing files
294
+ # in all cases.
295
+ log_rotation_age = 1d # Automatic rotation of logfiles will
296
+ # happen after that time. 0 disables.
297
+ log_rotation_size = 0 # Automatic rotation of logfiles will
298
+ # happen after that much log output.
299
+ # 0 disables.
300
+
301
+ # These are relevant when logging to syslog:
302
+ #syslog_facility = 'LOCAL0'
303
+ #syslog_ident = 'postgres'
304
+
305
+ #silent_mode = off # Run server silently.
306
+ # DO NOT USE without syslog or
307
+ # logging_collector
308
+ # (change requires restart)
309
+
310
+ # - When to Log -
311
+
312
+ #client_min_messages = notice # values in order of decreasing detail:
313
+ # debug5
314
+ # debug4
315
+ # debug3
316
+ # debug2
317
+ # debug1
318
+ # log
319
+ # notice
320
+ # warning
321
+ # error
322
+
323
+ #log_min_messages = warning # values in order of decreasing detail:
324
+ # debug5
325
+ # debug4
326
+ # debug3
327
+ # debug2
328
+ # debug1
329
+ # info
330
+ # notice
331
+ # warning
332
+ # error
333
+ # log
334
+ # fatal
335
+ # panic
336
+
337
+ #log_min_error_statement = error # values in order of decreasing detail:
338
+ # debug5
339
+ # debug4
340
+ # debug3
341
+ # debug2
342
+ # debug1
343
+ # info
344
+ # notice
345
+ # warning
346
+ # error
347
+ # log
348
+ # fatal
349
+ # panic (effectively off)
350
+
351
+ #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
352
+ # and their durations, > 0 logs only
353
+ # statements running at least this number
354
+ # of milliseconds
355
+
356
+ # - What to Log -
357
+
358
+ #debug_print_parse = off
359
+ #debug_print_rewritten = off
360
+ #debug_print_plan = off
361
+ #debug_pretty_print = on
362
+ #log_checkpoints = off
363
+ #log_connections = off
364
+ #log_disconnections = off
365
+ #log_duration = off
366
+ #log_error_verbosity = default # terse, default, or verbose messages
367
+ #log_hostname = off
368
+ log_line_prefix = '%t ' # special values:
369
+ # %a = application name
370
+ # %u = user name
371
+ # %d = database name
372
+ # %r = remote host and port
373
+ # %h = remote host
374
+ # %p = process ID
375
+ # %t = timestamp without milliseconds
376
+ # %m = timestamp with milliseconds
377
+ # %i = command tag
378
+ # %e = SQL state
379
+ # %c = session ID
380
+ # %l = session line number
381
+ # %s = session start timestamp
382
+ # %v = virtual transaction ID
383
+ # %x = transaction ID (0 if none)
384
+ # %q = stop here in non-session
385
+ # processes
386
+ # %% = '%'
387
+ # e.g. '<%u%%%d> '
388
+ #log_lock_waits = off # log lock waits >= deadlock_timeout
389
+ #log_statement = 'none' # none, ddl, mod, all
390
+ #log_temp_files = -1 # log temporary files equal or larger
391
+ # than the specified size in kilobytes;
392
+ # -1 disables, 0 logs all temp files
393
+ #log_timezone = '(defaults to server environment setting)'
394
+
395
+ #------------------------------------------------------------------------------
396
+ # RUNTIME STATISTICS
397
+ #------------------------------------------------------------------------------
398
+
399
+ # - Query/Index Statistics Collector -
400
+
401
+ #track_activities = on
402
+ #track_counts = on
403
+ #track_functions = none # none, pl, all
404
+ #track_activity_query_size = 1024 # (change requires restart)
405
+ #update_process_title = on
406
+ #stats_temp_directory = 'pg_stat_tmp'
407
+
408
+ # - Statistics Monitoring -
409
+
410
+ #log_parser_stats = off
411
+ #log_planner_stats = off
412
+ #log_executor_stats = off
413
+ #log_statement_stats = off
414
+
415
+ #------------------------------------------------------------------------------
416
+ # AUTOVACUUM PARAMETERS
417
+ #------------------------------------------------------------------------------
418
+
419
+ #autovacuum = on # Enable autovacuum subprocess? 'on'
420
+ # requires track_counts to also be on.
421
+ #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
422
+ # their durations, > 0 logs only
423
+ # actions running at least this number
424
+ # of milliseconds.
425
+ #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
426
+ # (change requires restart)
427
+ #autovacuum_naptime = 1min # time between autovacuum runs
428
+ #autovacuum_vacuum_threshold = 50 # min number of row updates before
429
+ # vacuum
430
+ #autovacuum_analyze_threshold = 50 # min number of row updates before
431
+ # analyze
432
+ #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
433
+ #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
434
+ #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
435
+ # (change requires restart)
436
+ #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
437
+ # autovacuum, in milliseconds;
438
+ # -1 means use vacuum_cost_delay
439
+ #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
440
+ # autovacuum, -1 means use
441
+ # vacuum_cost_limit
442
+
443
+ #------------------------------------------------------------------------------
444
+ # CLIENT CONNECTION DEFAULTS
445
+ #------------------------------------------------------------------------------
446
+
447
+ # - Statement Behavior -
448
+
449
+ #search_path = '"$user",public' # schema names
450
+ #default_tablespace = '' # a tablespace name, '' uses the default
451
+ #temp_tablespaces = '' # a list of tablespace names, '' uses
452
+ # only default tablespace
453
+ #check_function_bodies = on
454
+ #default_transaction_isolation = 'read committed'
455
+ #default_transaction_read_only = off
456
+ #default_transaction_deferrable = off
457
+ #session_replication_role = 'origin'
458
+ #statement_timeout = 0 # in milliseconds, 0 is disabled
459
+ #vacuum_freeze_min_age = 50000000
460
+ #vacuum_freeze_table_age = 150000000
461
+ #bytea_output = 'hex' # hex, escape
462
+ #xmlbinary = 'base64'
463
+ #xmloption = 'content'
464
+
465
+ # - Locale and Formatting -
466
+
467
+ datestyle = 'iso, mdy'
468
+ #intervalstyle = 'postgres'
469
+ #timezone = '(defaults to server environment setting)'
470
+ #timezone_abbreviations = 'Default' # Select the set of available time zone
471
+ # abbreviations. Currently, there are
472
+ # Default
473
+ # Australia
474
+ # India
475
+ # You can create your own file in
476
+ # share/timezonesets/.
477
+ #extra_float_digits = 0 # min -15, max 3
478
+ #client_encoding = sql_ascii # actually, defaults to database
479
+ # encoding
480
+
481
+ # These settings are initialized by initdb, but they can be changed.
482
+ lc_messages = 'en_US.UTF-8' # locale for system error message
483
+ # strings
484
+ lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
485
+ lc_numeric = 'en_US.UTF-8' # locale for number formatting
486
+ lc_time = 'en_US.UTF-8' # locale for time formatting
487
+
488
+ # default configuration for text search
489
+ default_text_search_config = 'pg_catalog.english'
490
+
491
+ # - Other Defaults -
492
+
493
+ #dynamic_library_path = '$libdir'
494
+ #local_preload_libraries = ''
495
+
496
+ #------------------------------------------------------------------------------
497
+ # LOCK MANAGEMENT
498
+ #------------------------------------------------------------------------------
499
+
500
+ #deadlock_timeout = 1s
501
+ #max_locks_per_transaction = 64 # min 10
502
+ # (change requires restart)
503
+ # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
504
+ # max_locks_per_transaction * (max_connections + max_prepared_transactions)
505
+ # lock table slots.
506
+ #max_pred_locks_per_transaction = 64 # min 10
507
+ # (change requires restart)
508
+
509
+ #------------------------------------------------------------------------------
510
+ # VERSION/PLATFORM COMPATIBILITY
511
+ #------------------------------------------------------------------------------
512
+
513
+ # - Previous PostgreSQL Versions -
514
+
515
+ #array_nulls = on
516
+ #backslash_quote = safe_encoding # on, off, or safe_encoding
517
+ #default_with_oids = off
518
+ #escape_string_warning = on
519
+ #lo_compat_privileges = off
520
+ #quote_all_identifiers = off
521
+ #sql_inheritance = on
522
+ #standard_conforming_strings = on
523
+ #synchronize_seqscans = on
524
+
525
+ # - Other Platforms and Clients -
526
+
527
+ #transform_null_equals = off
528
+
529
+ #------------------------------------------------------------------------------
530
+ # ERROR HANDLING
531
+ #------------------------------------------------------------------------------
532
+
533
+ #exit_on_error = off # terminate session on any error?
534
+ #restart_after_crash = on # reinitialize after backend crash?
535
+
536
+ #------------------------------------------------------------------------------
537
+ # CUSTOMIZED OPTIONS
538
+ #------------------------------------------------------------------------------
539
+
540
+ #custom_variable_classes = '' # list of custom variable class names
@@ -0,0 +1,42 @@
1
+ # PostgreSQL User Name Maps
2
+ # =========================
3
+ #
4
+ # Refer to the PostgreSQL documentation, chapter "Client
5
+ # Authentication" for a complete description. A short synopsis
6
+ # follows.
7
+ #
8
+ # This file controls PostgreSQL user name mapping. It maps external
9
+ # user names to their corresponding PostgreSQL user names. Records
10
+ # are of the form:
11
+ #
12
+ # MAPNAME SYSTEM-USERNAME PG-USERNAME
13
+ #
14
+ # (The uppercase quantities must be replaced by actual values.)
15
+ #
16
+ # MAPNAME is the (otherwise freely chosen) map name that was used in
17
+ # pg_hba.conf. SYSTEM-USERNAME is the detected user name of the
18
+ # client. PG-USERNAME is the requested PostgreSQL user name. The
19
+ # existence of a record specifies that SYSTEM-USERNAME may connect as
20
+ # PG-USERNAME.
21
+ #
22
+ # If SYSTEM-USERNAME starts with a slash (/), it will be treated as a
23
+ # regular expression. Optionally this can contain a capture (a
24
+ # parenthesized subexpression). The substring matching the capture
25
+ # will be substituted for \1 (backslash-one) if present in
26
+ # PG-USERNAME.
27
+ #
28
+ # Multiple maps may be specified in this file and used by pg_hba.conf.
29
+ #
30
+ # No map names are defined in the default configuration. If all
31
+ # system user names and PostgreSQL user names are the same, you don't
32
+ # need anything in this file.
33
+ #
34
+ # This file is read on server startup and when the postmaster receives
35
+ # a SIGHUP signal. If you edit the file on a running system, you have
36
+ # to SIGHUP the postmaster for the changes to take effect. You can
37
+ # use "pg_ctl reload" to do that.
38
+
39
+ # Put your actual configuration here
40
+ # ----------------------------------
41
+
42
+ # MAPNAME SYSTEM-USERNAME PG-USERNAME
@@ -112,7 +112,7 @@ shared_buffers = 256MB # min 128kB
112
112
  # per transaction slot, plus lock space (see max_locks_per_transaction).
113
113
  # It is not advisable to set max_prepared_transactions nonzero unless you
114
114
  # actively intend to use prepared transactions.
115
- work_mem = 16MB # min 64kB
115
+ work_mem = 128MB # min 64kB
116
116
  maintenance_work_mem = 128MB # min 1MB
117
117
  max_stack_depth = 4MB # min 100kB
118
118
 
@@ -149,7 +149,7 @@ effective_io_concurrency = 4 # 1-1000. 0 disables prefetching
149
149
  #wal_level = minimal # minimal, archive, or hot_standby
150
150
  # (change requires restart)
151
151
  #fsync = on # turns forced synchronization on or off
152
- #synchronous_commit = on # synchronization level; on, off, or local
152
+ synchronous_commit = off # synchronization level; on, off, or local
153
153
  #wal_sync_method = fsync # the default is the first option
154
154
  # supported by the operating system:
155
155
  # open_datasync
@@ -162,12 +162,12 @@ effective_io_concurrency = 4 # 1-1000. 0 disables prefetching
162
162
  # (change requires restart)
163
163
  #wal_writer_delay = 200ms # 1-10000 milliseconds
164
164
 
165
- #commit_delay = 0 # range 0-100000, in microseconds
165
+ commit_delay = 10000 # range 0-100000, in microseconds
166
166
  #commit_siblings = 5 # range 1-1000
167
167
 
168
168
  # - Checkpoints -
169
169
 
170
- #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
170
+ checkpoint_segments = 16 # in logfile segments, min 1, 16MB each
171
171
  #checkpoint_timeout = 5min # range 30s-1h
172
172
  #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
173
173
  #checkpoint_warning = 30s # 0 disables
@@ -42,13 +42,9 @@ class TestSyncWrap < MiniTest::Unit::TestCase
42
42
  include SyncWrap::JRuby
43
43
  include SyncWrap::Iyyov
44
44
  include SyncWrap::Geminabox
45
-
46
- include SyncWrap::RHEL
47
- include SyncWrap::Ubuntu # Not a recomendated combo
48
-
45
+ include SyncWrap::Ubuntu
49
46
  include SyncWrap::EC2
50
- include SyncWrap::PostgreSQL::Ubuntu
51
- include SyncWrap::PostgreSQL::EC2
47
+ include SyncWrap::PostgreSQL
52
48
  end
53
49
 
54
50
  def test_init
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: syncwrap
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.1
5
+ version: 1.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Kellum
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-25 00:00:00.000000000 Z
12
+ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -56,13 +56,9 @@ files:
56
56
  - Manifest.txt
57
57
  - README.rdoc
58
58
  - Rakefile
59
+ - etc/gemrc
59
60
  - etc/init.d/iyyov
60
- - etc/postgresql/9.1/main/environment
61
- - etc/postgresql/9.1/main/pg_ctl.conf
62
- - etc/postgresql/9.1/main/pg_hba.conf
63
- - etc/postgresql/9.1/main/pg_ident.conf
64
- - etc/postgresql/9.1/main/postgresql.conf
65
- - etc/postgresql/9.1/main/start.conf
61
+ - etc/sysconfig/pgsql/postgresql
66
62
  - etc/sysctl.d/61-postgresql-shm.conf
67
63
  - lib/syncwrap/base.rb
68
64
  - lib/syncwrap.rb
@@ -79,6 +75,15 @@ files:
79
75
  - lib/syncwrap/rhel.rb
80
76
  - lib/syncwrap/ubuntu.rb
81
77
  - lib/syncwrap/user_run.rb
78
+ - postgresql/rhel/pg_hba.conf
79
+ - postgresql/rhel/pg_ident.conf
80
+ - postgresql/rhel/postgresql.conf
81
+ - postgresql/ubuntu/environment
82
+ - postgresql/ubuntu/pg_ctl.conf
83
+ - postgresql/ubuntu/pg_hba.conf
84
+ - postgresql/ubuntu/pg_ident.conf
85
+ - postgresql/ubuntu/postgresql.conf
86
+ - postgresql/ubuntu/start.conf
82
87
  - test/test_syncwrap.rb
83
88
  - usr/local/bin/jgem
84
89
  - var/iyyov/jobs.rb