pvcglue 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +91 -0
  6. data/Rakefile +1 -0
  7. data/bin/pvc +13 -0
  8. data/lib/pvcglue.rb +43 -0
  9. data/lib/pvcglue/all_the_things.rb +7 -0
  10. data/lib/pvcglue/bootstrap.rb +8 -0
  11. data/lib/pvcglue/capistrano.rb +35 -0
  12. data/lib/pvcglue/cli.rb +150 -0
  13. data/lib/pvcglue/cloud.rb +278 -0
  14. data/lib/pvcglue/configuration.rb +157 -0
  15. data/lib/pvcglue/db.rb +145 -0
  16. data/lib/pvcglue/deploy.rb +4 -0
  17. data/lib/pvcglue/env.rb +141 -0
  18. data/lib/pvcglue/manager.rb +137 -0
  19. data/lib/pvcglue/nodes.rb +29 -0
  20. data/lib/pvcglue/packages.rb +47 -0
  21. data/lib/pvcglue/packages/bootstrap.rb +92 -0
  22. data/lib/pvcglue/packages/env.rb +80 -0
  23. data/lib/pvcglue/packages/firewall.rb +48 -0
  24. data/lib/pvcglue/packages/manager.rb +102 -0
  25. data/lib/pvcglue/packages/nginx.rb +10 -0
  26. data/lib/pvcglue/packages/nodejs.rb +17 -0
  27. data/lib/pvcglue/packages/passenger.rb +28 -0
  28. data/lib/pvcglue/packages/postgresql.rb +10 -0
  29. data/lib/pvcglue/packages/role_db.rb +47 -0
  30. data/lib/pvcglue/packages/role_lb.rb +64 -0
  31. data/lib/pvcglue/packages/role_memcached.rb +14 -0
  32. data/lib/pvcglue/packages/role_web.rb +60 -0
  33. data/lib/pvcglue/packages/rvm.rb +75 -0
  34. data/lib/pvcglue/packages/timezone.rb +17 -0
  35. data/lib/pvcglue/packages/ubuntu.rb +100 -0
  36. data/lib/pvcglue/railtie.rb +11 -0
  37. data/lib/pvcglue/ssl.rb +37 -0
  38. data/lib/pvcglue/templates/20auto-upgrades.erb +2 -0
  39. data/lib/pvcglue/templates/authorized_keys.erb +3 -0
  40. data/lib/pvcglue/templates/capfile.erb +20 -0
  41. data/lib/pvcglue/templates/database.yml.erb +57 -0
  42. data/lib/pvcglue/templates/denial_of_service.erb +3 -0
  43. data/lib/pvcglue/templates/deploy.rb.erb +81 -0
  44. data/lib/pvcglue/templates/gemrc.erb +1 -0
  45. data/lib/pvcglue/templates/hosts.erb +9 -0
  46. data/lib/pvcglue/templates/lb.nginx.conf.erb +88 -0
  47. data/lib/pvcglue/templates/lb.sites-enabled.erb +74 -0
  48. data/lib/pvcglue/templates/maintenance_mode.erb +46 -0
  49. data/lib/pvcglue/templates/memcached.conf.erb +55 -0
  50. data/lib/pvcglue/templates/passenger.list.erb +2 -0
  51. data/lib/pvcglue/templates/pg_hba.conf.erb +101 -0
  52. data/lib/pvcglue/templates/postgresql.conf.erb +557 -0
  53. data/lib/pvcglue/templates/sshd_config.erb +91 -0
  54. data/lib/pvcglue/templates/stage-deploy.rb.erb +33 -0
  55. data/lib/pvcglue/templates/timezone.erb +1 -0
  56. data/lib/pvcglue/templates/ufw.rules.erb +42 -0
  57. data/lib/pvcglue/templates/ufw.rules6.erb +25 -0
  58. data/lib/pvcglue/templates/web.bashrc.erb +120 -0
  59. data/lib/pvcglue/templates/web.env.erb +3 -0
  60. data/lib/pvcglue/templates/web.nginx.conf.erb +82 -0
  61. data/lib/pvcglue/templates/web.sites-enabled.erb +8 -0
  62. data/lib/pvcglue/toml_pvc_dumper.rb +53 -0
  63. data/lib/pvcglue/version.rb +3 -0
  64. data/pvcglue.gemspec +33 -0
  65. metadata +296 -0
@@ -0,0 +1,55 @@
1
+ # memcached default config file
2
+ # 2003 - Jay Bonci <jaybonci@debian.org>
3
+ # This configuration file is read by the start-memcached script provided as
4
+ # part of the Debian GNU/Linux distribution.
5
+
6
+ # Run memcached as a daemon. This command is implied, and is not needed for the
7
+ # daemon to run. See the README.Debian that comes with this package for more
8
+ # information.
9
+ -d
10
+
11
+ # Log memcached's output to /var/log/memcached
12
+ logfile /var/log/memcached.log
13
+
14
+ # Be verbose
15
+ # -v
16
+
17
+ # Be even more verbose (print client commands as well)
18
+ # -vv
19
+
20
+ # TODO: settings for memory, Max size per item, connection port etc...
21
+
22
+ # Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
23
+ # Note that the daemon will grow to this size, but does not start out holding this much
24
+ # memory
25
+ -m 256
26
+
27
+ # Default connection port is 11211
28
+ -p 11211
29
+
30
+ # Disable UDP
31
+ -U 0
32
+
33
+ # Run the daemon as root. The start-memcached will default to running as root if no
34
+ # -u command is present in this config file
35
+ -u memcache
36
+
37
+ # Specify which IP address to listen on. The default is to listen on all IP addresses
38
+ # This parameter is one of the only security measures that memcached has, so make sure
39
+ # it's listening on a firewalled interface.
40
+ -l 0.0.0.0
41
+
42
+ # Limit the number of simultaneous incoming connections. The daemon default is 1024
43
+ # -c 1024
44
+
45
+ # Lock down all paged memory. Consult with the README and homepage before you do this
46
+ # -k
47
+
48
+ # Return error when memory is exhausted (rather than removing items)
49
+ # -M
50
+
51
+ # Maximize core file limit
52
+ # -r
53
+
54
+ # Max size per item
55
+ -I 8M
@@ -0,0 +1,2 @@
1
+ # Ubuntu 12.04
2
+ deb https://oss-binaries.phusionpassenger.com/apt/passenger precise main
@@ -0,0 +1,101 @@
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
+
76
+
77
+
78
+ # DO NOT DISABLE!
79
+ # If you change this first entry you will need to make sure that the
80
+ # database superuser can access the database using some other method.
81
+ # Noninteractive access to all databases is required during automatic
82
+ # maintenance (custom daily cronjobs, replication, and similar tasks).
83
+ #
84
+ # Database administrative login by Unix domain socket
85
+ local all postgres peer
86
+ host all all 0.0.0.0/0 md5
87
+
88
+ # TYPE DATABASE USER ADDRESS METHOD
89
+
90
+ # "local" is for Unix domain socket connections only
91
+ #local all all peer
92
+ # IPv4 local connections:
93
+ #host all all 127.0.0.1/32 md5
94
+ # IPv6 local connections:
95
+ #host all all ::1/128 md5
96
+ # Allow replication connections from localhost, by a user with the
97
+ # replication privilege.
98
+ #local replication postgres peer
99
+ #host replication postgres 127.0.0.1/32 md5
100
+ #host replication postgres ::1/128 md5
101
+ # Allow external connection
@@ -0,0 +1,557 @@
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
+ #------------------------------------------------------------------------------
35
+ # FILE LOCATIONS
36
+ #------------------------------------------------------------------------------
37
+
38
+ # The default values of these variables are driven from the -D command-line
39
+ # option or PGDATA environment variable, represented here as ConfigDir.
40
+
41
+ data_directory = '/var/lib/postgresql/9.1/main' # use data in another directory
42
+ # (change requires restart)
43
+ hba_file = '/etc/postgresql/9.1/main/pg_hba.conf' # host-based authentication file
44
+ # (change requires restart)
45
+ ident_file = '/etc/postgresql/9.1/main/pg_ident.conf' # ident configuration file
46
+ # (change requires restart)
47
+
48
+ # If external_pid_file is not explicitly set, no extra PID file is written.
49
+ external_pid_file = '/var/run/postgresql/9.1-main.pid' # write an extra PID file
50
+ # (change requires restart)
51
+
52
+
53
+ #------------------------------------------------------------------------------
54
+ # CONNECTIONS AND AUTHENTICATION
55
+ #------------------------------------------------------------------------------
56
+
57
+ # - Connection Settings -
58
+
59
+ listen_addresses = '*' # what IP address(es) to listen on;
60
+ # comma-separated list of addresses;
61
+ # defaults to 'localhost', '*' = all
62
+ # (change requires restart)
63
+ port = 5432 # (change requires restart)
64
+ max_connections = 100 # (change requires restart)
65
+ # Note: Increasing max_connections costs ~400 bytes of shared memory per
66
+ # connection slot, plus lock space (see max_locks_per_transaction).
67
+ #superuser_reserved_connections = 3 # (change requires restart)
68
+ unix_socket_directory = '/var/run/postgresql' # (change requires restart)
69
+ #unix_socket_group = '' # (change requires restart)
70
+ #unix_socket_permissions = 0777 # begin with 0 to use octal notation
71
+ # (change requires restart)
72
+ #bonjour = off # advertise server via Bonjour
73
+ # (change requires restart)
74
+ #bonjour_name = '' # defaults to the computer name
75
+ # (change requires restart)
76
+
77
+ # - Security and Authentication -
78
+
79
+ #authentication_timeout = 1min # 1s-600s
80
+ ssl = true # (change requires restart)
81
+ #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
82
+ # (change requires restart)
83
+ #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
84
+ #password_encryption = on
85
+ #db_user_namespace = off
86
+
87
+ # Kerberos and GSSAPI
88
+ #krb_server_keyfile = ''
89
+ #krb_srvname = 'postgres' # (Kerberos only)
90
+ #krb_caseins_users = off
91
+
92
+ # - TCP Keepalives -
93
+ # see "man 7 tcp" for details
94
+
95
+ #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
96
+ # 0 selects the system default
97
+ #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
98
+ # 0 selects the system default
99
+ #tcp_keepalives_count = 0 # TCP_KEEPCNT;
100
+ # 0 selects the system default
101
+
102
+
103
+ #------------------------------------------------------------------------------
104
+ # RESOURCE USAGE (except WAL)
105
+ #------------------------------------------------------------------------------
106
+
107
+ # - Memory -
108
+
109
+ shared_buffers = 24MB # min 128kB
110
+ #shared_buffers = 4GB # 25% of system memory must also modify: /etc/sysctl.d/30-postgresql-shm.conf then run sysctl -p see http://serverfault.com/a/499387/156820
111
+ # (change requires restart)
112
+ #temp_buffers = 8MB # min 800kB
113
+ #max_prepared_transactions = 0 # zero disables the feature
114
+ # (change requires restart)
115
+ # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
116
+ # per transaction slot, plus lock space (see max_locks_per_transaction).
117
+ # It is not advisable to set max_prepared_transactions nonzero unless you
118
+ # actively intend to use prepared transactions.
119
+ #work_mem = 1MB # min 64kB
120
+ #maintenance_work_mem = 16MB # min 1MB
121
+ #max_stack_depth = 2MB # min 100kB
122
+
123
+ # - Kernel Resource Usage -
124
+
125
+ #max_files_per_process = 1000 # min 25
126
+ # (change requires restart)
127
+ #shared_preload_libraries = '' # (change requires restart)
128
+
129
+ # - Cost-Based Vacuum Delay -
130
+
131
+ #vacuum_cost_delay = 0ms # 0-100 milliseconds
132
+ #vacuum_cost_page_hit = 1 # 0-10000 credits
133
+ #vacuum_cost_page_miss = 10 # 0-10000 credits
134
+ #vacuum_cost_page_dirty = 20 # 0-10000 credits
135
+ #vacuum_cost_limit = 200 # 1-10000 credits
136
+
137
+ # - Background Writer -
138
+
139
+ #bgwriter_delay = 200ms # 10-10000ms between rounds
140
+ #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
141
+ #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
142
+
143
+ # - Asynchronous Behavior -
144
+
145
+ #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
146
+
147
+
148
+ #------------------------------------------------------------------------------
149
+ # WRITE AHEAD LOG
150
+ #------------------------------------------------------------------------------
151
+
152
+ # - Settings -
153
+
154
+ #wal_level = minimal # minimal, archive, or hot_standby
155
+ # (change requires restart)
156
+ #fsync = on # turns forced synchronization on or off
157
+ #synchronous_commit = on # synchronization level; on, off, or local
158
+ #wal_sync_method = fsync # the default is the first option
159
+ # supported by the operating system:
160
+ # open_datasync
161
+ # fdatasync (default on Linux)
162
+ # fsync
163
+ # fsync_writethrough
164
+ # open_sync
165
+ #full_page_writes = on # recover from partial page writes
166
+ #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
167
+ # (change requires restart)
168
+ #wal_writer_delay = 200ms # 1-10000 milliseconds
169
+
170
+ #commit_delay = 0 # range 0-100000, in microseconds
171
+ #commit_siblings = 5 # range 1-1000
172
+
173
+ # - Checkpoints -
174
+
175
+ #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
176
+ #checkpoint_timeout = 5min # range 30s-1h
177
+ #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
178
+ #checkpoint_warning = 30s # 0 disables
179
+
180
+ # - Archiving -
181
+
182
+ #archive_mode = off # allows archiving to be done
183
+ # (change requires restart)
184
+ #archive_command = '' # command to use to archive a logfile segment
185
+ #archive_timeout = 0 # force a logfile segment switch after this
186
+ # number of seconds; 0 disables
187
+
188
+
189
+ #------------------------------------------------------------------------------
190
+ # REPLICATION
191
+ #------------------------------------------------------------------------------
192
+
193
+ # - Master Server -
194
+
195
+ # These settings are ignored on a standby server
196
+
197
+ #max_wal_senders = 0 # max number of walsender processes
198
+ # (change requires restart)
199
+ #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
200
+ #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
201
+ #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
202
+ #replication_timeout = 60s # in milliseconds; 0 disables
203
+ #synchronous_standby_names = '' # standby servers that provide sync rep
204
+ # comma-separated list of application_name
205
+ # from standby(s); '*' = all
206
+
207
+ # - Standby Servers -
208
+
209
+ # These settings are ignored on a master server
210
+
211
+ #hot_standby = off # "on" allows queries during recovery
212
+ # (change requires restart)
213
+ #max_standby_archive_delay = 30s # max delay before canceling queries
214
+ # when reading WAL from archive;
215
+ # -1 allows indefinite delay
216
+ #max_standby_streaming_delay = 30s # max delay before canceling queries
217
+ # when reading streaming WAL;
218
+ # -1 allows indefinite delay
219
+ #wal_receiver_status_interval = 10s # send replies at least this often
220
+ # 0 disables
221
+ #hot_standby_feedback = off # send info from standby to prevent
222
+ # query conflicts
223
+
224
+
225
+ #------------------------------------------------------------------------------
226
+ # QUERY TUNING
227
+ #------------------------------------------------------------------------------
228
+
229
+ # - Planner Method Configuration -
230
+
231
+ #enable_bitmapscan = on
232
+ #enable_hashagg = on
233
+ #enable_hashjoin = on
234
+ #enable_indexscan = on
235
+ #enable_material = on
236
+ #enable_mergejoin = on
237
+ #enable_nestloop = on
238
+ #enable_seqscan = on
239
+ #enable_sort = on
240
+ #enable_tidscan = on
241
+
242
+ # - Planner Cost Constants -
243
+
244
+ #seq_page_cost = 1.0 # measured on an arbitrary scale
245
+ #random_page_cost = 4.0 # same scale as above
246
+ #cpu_tuple_cost = 0.01 # same scale as above
247
+ #cpu_index_tuple_cost = 0.005 # same scale as above
248
+ #cpu_operator_cost = 0.0025 # same scale as above
249
+ #effective_cache_size = 128MB
250
+ effective_cache_size = 8GB # 50% memory
251
+
252
+ # - Genetic Query Optimizer -
253
+
254
+ #geqo = on
255
+ #geqo_threshold = 12
256
+ #geqo_effort = 5 # range 1-10
257
+ #geqo_pool_size = 0 # selects default based on effort
258
+ #geqo_generations = 0 # selects default based on effort
259
+ #geqo_selection_bias = 2.0 # range 1.5-2.0
260
+ #geqo_seed = 0.0 # range 0.0-1.0
261
+
262
+ # - Other Planner Options -
263
+
264
+ #default_statistics_target = 100 # range 1-10000
265
+ #constraint_exclusion = partition # on, off, or partition
266
+ #cursor_tuple_fraction = 0.1 # range 0.0-1.0
267
+ #from_collapse_limit = 8
268
+ #join_collapse_limit = 8 # 1 disables collapsing of explicit
269
+ # JOIN clauses
270
+
271
+
272
+ #------------------------------------------------------------------------------
273
+ # ERROR REPORTING AND LOGGING
274
+ #------------------------------------------------------------------------------
275
+
276
+ # - Where to Log -
277
+
278
+ #log_destination = 'stderr' # Valid values are combinations of
279
+ # stderr, csvlog, syslog, and eventlog,
280
+ # depending on platform. csvlog
281
+ # requires logging_collector to be on.
282
+
283
+ # This is used when logging to stderr:
284
+ #logging_collector = off # Enable capturing of stderr and csvlog
285
+ # into log files. Required to be on for
286
+ # csvlogs.
287
+ # (change requires restart)
288
+
289
+ # These are only used if logging_collector is on:
290
+ #log_directory = 'pg_log' # directory where log files are written,
291
+ # can be absolute or relative to PGDATA
292
+ #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
293
+ # can include strftime() escapes
294
+ #log_file_mode = 0600 # creation mode for log files,
295
+ # begin with 0 to use octal notation
296
+ #log_truncate_on_rotation = off # If on, an existing log file with the
297
+ # same name as the new log file will be
298
+ # truncated rather than appended to.
299
+ # But such truncation only occurs on
300
+ # time-driven rotation, not on restarts
301
+ # or size-driven rotation. Default is
302
+ # off, meaning append to existing files
303
+ # in all cases.
304
+ #log_rotation_age = 1d # Automatic rotation of logfiles will
305
+ # happen after that time. 0 disables.
306
+ #log_rotation_size = 10MB # Automatic rotation of logfiles will
307
+ # happen after that much log output.
308
+ # 0 disables.
309
+
310
+ # These are relevant when logging to syslog:
311
+ #syslog_facility = 'LOCAL0'
312
+ #syslog_ident = 'postgres'
313
+
314
+ #silent_mode = off # Run server silently.
315
+ # DO NOT USE without syslog or
316
+ # logging_collector
317
+ # (change requires restart)
318
+
319
+
320
+ # - When to Log -
321
+
322
+ #client_min_messages = notice # values in order of decreasing detail:
323
+ # debug5
324
+ # debug4
325
+ # debug3
326
+ # debug2
327
+ # debug1
328
+ # log
329
+ # notice
330
+ # warning
331
+ # error
332
+
333
+ #log_min_messages = warning # values in order of decreasing detail:
334
+ # debug5
335
+ # debug4
336
+ # debug3
337
+ # debug2
338
+ # debug1
339
+ # info
340
+ # notice
341
+ # warning
342
+ # error
343
+ # log
344
+ # fatal
345
+ # panic
346
+
347
+ #log_min_error_statement = error # values in order of decreasing detail:
348
+ # debug5
349
+ # debug4
350
+ # debug3
351
+ # debug2
352
+ # debug1
353
+ # info
354
+ # notice
355
+ # warning
356
+ # error
357
+ # log
358
+ # fatal
359
+ # panic (effectively off)
360
+
361
+ #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
362
+ # and their durations, > 0 logs only
363
+ # statements running at least this number
364
+ # of milliseconds
365
+
366
+
367
+ # - What to Log -
368
+
369
+ #debug_print_parse = off
370
+ #debug_print_rewritten = off
371
+ #debug_print_plan = off
372
+ #debug_pretty_print = on
373
+ #log_checkpoints = off
374
+ #log_connections = off
375
+ #log_disconnections = off
376
+ #log_duration = off
377
+ #log_error_verbosity = default # terse, default, or verbose messages
378
+ #log_hostname = off
379
+ log_line_prefix = '%t ' # special values:
380
+ # %a = application name
381
+ # %u = user name
382
+ # %d = database name
383
+ # %r = remote host and port
384
+ # %h = remote host
385
+ # %p = process ID
386
+ # %t = timestamp without milliseconds
387
+ # %m = timestamp with milliseconds
388
+ # %i = command tag
389
+ # %e = SQL state
390
+ # %c = session ID
391
+ # %l = session line number
392
+ # %s = session start timestamp
393
+ # %v = virtual transaction ID
394
+ # %x = transaction ID (0 if none)
395
+ # %q = stop here in non-session
396
+ # processes
397
+ # %% = '%'
398
+ #log_lock_waits = off # log lock waits >= deadlock_timeout
399
+ #log_statement = 'none' # none, ddl, mod, all
400
+ #log_temp_files = -1 # log temporary files equal or larger
401
+ # than the specified size in kilobytes;
402
+ # -1 disables, 0 logs all temp files
403
+ #log_timezone = '(defaults to server environment setting)'
404
+
405
+
406
+ #------------------------------------------------------------------------------
407
+ # RUNTIME STATISTICS
408
+ #------------------------------------------------------------------------------
409
+
410
+ # - Query/Index Statistics Collector -
411
+
412
+ #track_activities = on
413
+ #track_counts = on
414
+ #track_functions = none # none, pl, all
415
+ #track_activity_query_size = 1024 # (change requires restart)
416
+ #update_process_title = on
417
+ #stats_temp_directory = 'pg_stat_tmp'
418
+
419
+
420
+ # - Statistics Monitoring -
421
+
422
+ #log_parser_stats = off
423
+ #log_planner_stats = off
424
+ #log_executor_stats = off
425
+ #log_statement_stats = off
426
+
427
+
428
+ #------------------------------------------------------------------------------
429
+ # AUTOVACUUM PARAMETERS
430
+ #------------------------------------------------------------------------------
431
+
432
+ #autovacuum = on # Enable autovacuum subprocess? 'on'
433
+ # requires track_counts to also be on.
434
+ #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
435
+ # their durations, > 0 logs only
436
+ # actions running at least this number
437
+ # of milliseconds.
438
+ #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
439
+ # (change requires restart)
440
+ #autovacuum_naptime = 1min # time between autovacuum runs
441
+ #autovacuum_vacuum_threshold = 50 # min number of row updates before
442
+ # vacuum
443
+ #autovacuum_analyze_threshold = 50 # min number of row updates before
444
+ # analyze
445
+ #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
446
+ #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
447
+ #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
448
+ # (change requires restart)
449
+ #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
450
+ # autovacuum, in milliseconds;
451
+ # -1 means use vacuum_cost_delay
452
+ #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
453
+ # autovacuum, -1 means use
454
+ # vacuum_cost_limit
455
+
456
+
457
+ #------------------------------------------------------------------------------
458
+ # CLIENT CONNECTION DEFAULTS
459
+ #------------------------------------------------------------------------------
460
+
461
+ # - Statement Behavior -
462
+
463
+ #search_path = '"$user",public' # schema names
464
+ #default_tablespace = '' # a tablespace name, '' uses the default
465
+ #temp_tablespaces = '' # a list of tablespace names, '' uses
466
+ # only default tablespace
467
+ #check_function_bodies = on
468
+ #default_transaction_isolation = 'read committed'
469
+ #default_transaction_read_only = off
470
+ #default_transaction_deferrable = off
471
+ #session_replication_role = 'origin'
472
+ #statement_timeout = 0 # in milliseconds, 0 is disabled
473
+ #vacuum_freeze_min_age = 50000000
474
+ #vacuum_freeze_table_age = 150000000
475
+ #bytea_output = 'hex' # hex, escape
476
+ #xmlbinary = 'base64'
477
+ #xmloption = 'content'
478
+
479
+ # - Locale and Formatting -
480
+
481
+ datestyle = 'iso, mdy'
482
+ #intervalstyle = 'postgres'
483
+ #timezone = '(defaults to server environment setting)'
484
+ #timezone_abbreviations = 'Default' # Select the set of available time zone
485
+ # abbreviations. Currently, there are
486
+ # Default
487
+ # Australia
488
+ # India
489
+ # You can create your own file in
490
+ # share/timezonesets/.
491
+ #extra_float_digits = 0 # min -15, max 3
492
+ #client_encoding = sql_ascii # actually, defaults to database
493
+ # encoding
494
+
495
+ # These settings are initialized by initdb, but they can be changed.
496
+ lc_messages = 'en_US.UTF-8' # locale for system error message
497
+ # strings
498
+ lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
499
+ lc_numeric = 'en_US.UTF-8' # locale for number formatting
500
+ lc_time = 'en_US.UTF-8' # locale for time formatting
501
+
502
+ # default configuration for text search
503
+ default_text_search_config = 'pg_catalog.english'
504
+
505
+ # - Other Defaults -
506
+
507
+ #dynamic_library_path = '$libdir'
508
+ #local_preload_libraries = ''
509
+
510
+
511
+ #------------------------------------------------------------------------------
512
+ # LOCK MANAGEMENT
513
+ #------------------------------------------------------------------------------
514
+
515
+ #deadlock_timeout = 1s
516
+ #max_locks_per_transaction = 64 # min 10
517
+ # (change requires restart)
518
+ # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
519
+ # max_locks_per_transaction * (max_connections + max_prepared_transactions)
520
+ # lock table slots.
521
+ #max_pred_locks_per_transaction = 64 # min 10
522
+ # (change requires restart)
523
+
524
+ #------------------------------------------------------------------------------
525
+ # VERSION/PLATFORM COMPATIBILITY
526
+ #------------------------------------------------------------------------------
527
+
528
+ # - Previous PostgreSQL Versions -
529
+
530
+ #array_nulls = on
531
+ #backslash_quote = safe_encoding # on, off, or safe_encoding
532
+ #default_with_oids = off
533
+ #escape_string_warning = on
534
+ #lo_compat_privileges = off
535
+ #quote_all_identifiers = off
536
+ #sql_inheritance = on
537
+ #standard_conforming_strings = on
538
+ #synchronize_seqscans = on
539
+
540
+ # - Other Platforms and Clients -
541
+
542
+ #transform_null_equals = off
543
+
544
+
545
+ #------------------------------------------------------------------------------
546
+ # ERROR HANDLING
547
+ #------------------------------------------------------------------------------
548
+
549
+ #exit_on_error = off # terminate session on any error?
550
+ #restart_after_crash = on # reinitialize after backend crash?
551
+
552
+
553
+ #------------------------------------------------------------------------------
554
+ # CUSTOMIZED OPTIONS
555
+ #------------------------------------------------------------------------------
556
+
557
+ #custom_variable_classes = '' # list of custom variable class names