~thomir-deactivatedaccount/charms/trusty/postgresql/fix-for-lxc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
options:
  admin_addresses:
    default: ""
    type: string
    description: |
      A comma-separated list of IP Addresses (or single IP) admin tools like 
      pgAdmin3 will connect from, this is most useful for developers running 
      juju in local mode who need to connect tools like pgAdmin to a postgres. 
      The IP addresses added here will be included in the pg_hba.conf file 
      allowing ip connections to all databases on the server from the given 
      using md5 password encryption.
  locale:
    default: "C"
    type: string
    description: |
      Locale of service, defining language, default collation order,
      and default formatting of numbers, currency, dates & times. Can only be
      set when deploying the first unit of a service.
  encoding:
    default: "UTF-8"
    type: string
    description: |
      Default encoding used to store text in this service. Can only be
      set when deploying the first unit of a service.
  extra-packages:
    default: ""
    type: string
    description: Extra packages to install on the postgresql service units.
  dumpfile_location:
    default: "None"
    type: string
    description: |
        Path to a dumpfile to load into DB when service is initiated.
  config_change_command:
    default: "reload"
    type: string
    description: |
        The command to run whenever config has changed. Accepted values
        are "reload" or "restart" - any other value will mean neither is
        executed after a config change (which may be desired, if you're
        running a production server and would rather handle these out of
        band). Note that postgresql will still need to be reloaded
        whenever authentication and access details are updated, so
        disabling either doesn't mean PostgreSQL will never be reloaded.
  version:
    default: null
    type: string
    description: |
        Version of PostgreSQL that we want to install. Supported versions
        are "9.1", "9.2", "9.3". The default version for the deployed Ubuntu
        release is used when the version is not specified.
  cluster_name:
    default: "main"
    type: string
    description: Name of the cluster we want to install the DBs into
  listen_ip:
    default: "*"
    type: string
    description: IP to listen on
  listen_port:
    default: null
    type: int
    description: Port to listen on. Default is automatically assigned.
  max_connections:
    default: 100
    type: int
    description: Maximum number of connections to allow to the PG database
  ssl:
    default: "True"
    type: string
    description: Whether PostgreSQL should talk SSL
  log_min_duration_statement:
    default: -1
    type: int
    description: |
        -1 is disabled, 0 logs all statements
        and their durations, > 0 logs only
        statements running at least this number
        of milliseconds
  log_checkpoints:
    default: False
    type: boolean
    description: Log checkpoints
  log_connections:
    default: False
    type: boolean
    description: Log connections
  log_disconnections:
    default: False
    type: boolean
    description: Log disconnections
  log_temp_files:
    default: "-1"
    type: string
    description: |
        Log creation of temporary files larger than the threshold.
        -1 disables the feature, 0 logs all temporary files, or specify
        the threshold size with an optional unit (eg. "512KB", default
        unit is kilobytes).
  log_line_prefix:
    default: "%t [%p]: [%l-1] db=%d,user=%u "
    type: string
    description: |
        special values:
          %a = application name
          %u = user name
          %d = database name
          %r = remote host and port
          %h = remote host
          %p = process ID
          %t = timestamp without milliseconds
          %m = timestamp with milliseconds
          %i = command tag
          %e = SQL state
          %c = session ID
          %l = session line number
          %s = session start timestamp
          %v = virtual transaction ID
          %x = transaction ID (0 if none)
          %q = stop here in non-session processes
          %% = '%'
        e.g. '<%u%%%d> '
  log_lock_waits:
    default: False
    type: boolean
    description: log lock waits >= deadlock_timeout
  log_timezone:
    default: "UTC"
    type: string
    description: Log timezone
  autovacuum:
    default: True
    type: boolean
    description: |
        Autovacuum should almost always be running. If you want to turn this
        off, you are probably following out of date documentation.
  log_autovacuum_min_duration:
    default: -1
    type: int
    description: |
        -1 disables, 0 logs all actions and their durations, > 0 logs only
        actions running at least this number of milliseconds.
  autovacuum_analyze_threshold:
    default: 50
    type: int
    description: min number of row updates before analyze
  autovacuum_vacuum_scale_factor:
    default: 0.2
    type: float
    description: Fraction of table size before vacuum
  autovacuum_analyze_scale_factor:
    default: 0.1  
    type: float
    description: Fraction of table size before analyze
  autovacuum_vacuum_cost_delay:
    default: "20ms"
    type: string
    description: |
        Default vacuum cost delay for autovacuum, in milliseconds;
        -1 means use vacuum_cost_delay
  search_path:
    default: "\"$user\",public"
    type: string
    description: |
        Comma separated list of schema names for
        the default SQL search path.
  standard_conforming_strings:
    default: True
    type: boolean
    description: Standard conforming strings
  hot_standby:
    default: False
    type: boolean
    description: |
        DEPRECATED.
        Hot standby or warm standby. When True, queries can be run against
        the database when in recovery or standby mode (ie. replicated).
        Overridden when service contains multiple units.
  hot_standby_feedback:
    default: False
    type: boolean
    description: |
        Hot standby feedback, informing a master about in progress
        transactions on a streaming hot standby and allowing the master to
        defer cleanup and avoid query cancelations on the hot standby.
  wal_level:
    default: minimal
    type: string
    description: |
        'minimal', 'archive' or 'hot_standby'. Defines how much information
        is written to the WAL. Set to 'minimal' for stand alone databases
        and 'hot_standby' for replicated setups. Overridden by juju when
        replication is used.
  max_wal_senders:
    default: 0
    type: int
    description: |
        Maximum number of hot standbys that can connect using
        streaming replication. Set this to the expected maximum number of
        hot standby units to avoid unnecessary blocking and database restarts.
        Overridden by juju if necessary.
  wal_keep_segments:
    default: 0
    type: int
    description: |
        Number of old WAL files to keep, providing a larger buffer for
        streaming hot standbys to catch up from when lagged. Each WAL file
        is 16MB in size. The WAL files are the buffer of how far a
        hot standby can lag behind the master, and replication fails if
        this buffer is overrun. When this service is replicated, the larger
        value of wal_keep_segments and replicated_wal_keep_segments is used.
  replicated_wal_keep_segments:
    default: 5000
    type: int
    description: |
        Value of wal_keep_segments used when this service is replicated.
        This setting only exists to provide a sane default when replication
        is requested (so it doesn't fail) and nobody bothered to change the
        wal_keep_segments setting.
  archive_mode:
    default: False
    type: boolean
    description: |
        Enable archiving of WAL files using the command specified by
        archive_command. If archive_mode is enabled and archive_command not
        set, then archiving is deferred until archive_command is set and the
        WAL files will accumulate.
  archive_command:
    default: ""
    type: string
    description: |
        Command used to archive WAL files when archive_mode is set and
        wal_level > minimal.
  work_mem:
    default: "1MB"
    type: string
    description: |
        Working Memory.
        Ignored unless 'performance_tuning' is set to 'manual'.
  maintenance_work_mem:
    default: "1MB"
    type: string
    description: |
        Maintenance working memory.
        Ignored unless 'performance_tuning' is set to 'manual'.
  performance_tuning:
    default: "Mixed"
    type: string
    description: |
        Possible values here are "manual", "DW" (data warehouse),
        "OLTP" (online transaction processing), "Web" (web application),
        "Desktop" or "Mixed". When this is set to a value other than
        "manual", the charm invokes the pgtune tool to tune a number
        of performance parameters based on the specified load type.
        pgtune gathers information about the node on which you are deployed and
        tries to make intelligent guesses about what tuning parameters to set
        based on available RAM and CPU under the assumption that it's the only
        significant service running on this node.
  kernel_shmall:
    default: 0
    type: int
    description: Total amount of shared memory available, in bytes.
  kernel_shmmax:
    default: 0
    type: int
    description: The maximum size, in bytes, of a shared memory segment.
  shared_buffers:
    default: ""
    type: string
    description: |
        The amount of memory the database server uses for shared memory
        buffers. This string should be of the format '###MB'.
        Ignored unless 'performance_tuning' is set to 'manual'.
  effective_cache_size:
    default: ""
    type: string
    description: |
        Effective cache size is an estimate of how much memory is available for
        disk caching within the database. (50% to 75% of system memory). This
        string should be of the format '###MB'. Ignored unless
        'performance_tuning' is set to 'manual'.
  temp_buffers:
    default: "1MB"
    type: string
    description: |
        The maximum number of temporary buffers used by each database session.
  wal_buffers:
    default: "-1"
    type: string
    description: |
        min 32kB, -1 sets based on shared_buffers (change requires restart).
        Ignored unless 'performance_tuning' is set to 'manual'.
  checkpoint_segments:
    default: 3
    type: int
    description: |
        in logfile segments, min 1, 16MB each.
        Ignored unless 'performance_tuning' is set to 'manual'.
  checkpoint_timeout:
    default: ""
    type: string
    description: |
        Maximum time between automatic WAL checkpoints. range '30s-1h'.
        If left empty, the default postgresql value will be used.
  fsync:
    type: boolean
    default: True
    description: |
        Turns forced synchronization on/off. If fsync is turned off, database
        failures are likely to involve database corruption and require
        recreating the unit
  synchronous_commit:
    type: boolean
    default: True
    description: |
        Immediate fsync after commit.
  full_page_writes:
    type: boolean
    default: True
    description: |
        Recover from partial page writes.
  random_page_cost:
    default: 4.0
    type: float
    description: Random page cost
  extra_pg_auth:
    type: string
    default: ""
    description: |
        A comma separated extra pg_hba.conf auth rules.
        This will be written to the pg_hba.conf file, one line per rule.
        Note that this should not be needed as db relations already create
        those rules the right way. Only use this if you really need too
        (e.g. on a development environment)
  backup_dir:
    default: "/var/lib/postgresql/backups"
    type: string
    description: Directory to place backups in
  backup_schedule:
    default: "13 4 * * *"
    type: string
    description: Cron-formatted schedule for database backups.
  backup_retention_count:
    default: 7
    type: int
    description: Number of recent backups to retain.
  nagios_context:
    default: "juju"
    type: string
    description: |
        Used by the nrpe-external-master subordinate charm.
        A string that will be prepended to instance name to set the host name
        in nagios. So for instance the hostname would be something like:
            juju-postgresql-0
        If you're running multiple environments with the same services in them
        this allows you to differentiate between them.
  pgdg:
    description: |
        Enable the PostgreSQL Global Development Group APT repository
        (https://wiki.postgresql.org/wiki/Apt). This package source provides
        official PostgreSQL packages for Ubuntu LTS releases beyond those
        provided by the main Ubuntu archive.
    type: boolean
    default: false
  install_sources:
    description: |
        List of extra package sources, per charm-helpers standard.
        YAML format.
    type: string
    default: null
  install_keys:
    description: |
        List of signing keys for install_sources package sources, per
        charmhelpers standard. YAML format.
    type: string
    default: null
  extra_archives:
    default: ""
    type: string
    description: |
        DEPRECATED & IGNORED. Use install_sources and install_keys. 
  advisory_lock_restart_key:
    default: 765
    type: int
    description: |
        An advisory lock key used internally by the charm. You do not need
        to change it unless it happens to conflict with an advisory lock key
        being used by your applications.
  # Swift backups and PITR via SwiftWAL
  swiftwal_container_prefix:
    type: string
    default: null
    description: |
      EXPERIMENTAL.
      Swift container prefix for SwiftWAL to use. Must be set if any
      SwiftWAL features are enabled. This will become a simple
      swiftwal_container config item when proper leader election is
      implemented in juju.
  swiftwal_backup_schedule:
    type: string
    default: null
    description: |
      EXPERIMENTAL.
      Cron-formatted schedule for SwiftWAL database backups.
  swiftwal_backup_retention:
    type: int
    default: 2
    description: |
      EXPERIMENTAL.
      Number of recent base backups to retain. You need enough space in
      Swift for this many backups plus one more, as an old backup will only
      be removed after a new one has been successfully made to replace it.
  swiftwal_log_shipping:
    type: boolean
    default: false
    description: |
      EXPERIMENTAL.
      Archive WAL files into Swift. If swiftwal_backup_schedule is set,
      allows point-in-time recovery and WAL files are removed
      automatically with old backups. If swiftwal_backup_schedule is not set
      then WAL files are never removed. Enabling this option will override
      the archive_mode and archive_command settings.
  wal_e_storage_uri:
    type: string
    default: null
    description: |
      EXPERIMENTAL.
      Specify storage to be used by WAL-E. Every PostgreSQL service must use
      a unique URI. Backups will be unrecoverable if it is not unique. The
      URI's scheme must be one of 'swift' (OpenStack Swift), 's3' (Amazon AWS)
      or 'wabs' (Windows Azure). For example:
        'swift://some-container/directory/or/whatever'
        's3://some-bucket/directory/or/whatever'
        'wabs://some-bucket/directory/or/whatever'
      Setting the wal_e_storage_uri enables regular WAL-E filesystem level
      backups (per wal_e_backup_schedule), and log shipping to the configured
      storage. Point-in-time recovery becomes possible, as is disabling the
      streaming_replication configuration item and relying solely on
      log shipping for replication.
  wal_e_backup_schedule:
    type: string
    default: "13 0 * * *"
    description: |
      EXPERIMENTAL.
      Cron-formatted schedule for WAL-E database backups. If
      wal_e_backup_schedule is unset, WAL files will never be removed from
      WAL-E storage.
  wal_e_backup_retention:
    type: int
    default: 2
    description: |
      EXPERIMENTAL.
      Number of recent base backups and WAL files to retain.
      You need enough space for this many backups plus one more, as
      an old backup will only be removed after a new one has been
      successfully made to replace it.
  streaming_replication:
    type: boolean
    default: true
    description: |
      Enable streaming replication. Normally, streaming replication is
      always used, and any log shipping configured is used as a fallback.
      Turning this off without configuring log shipping is an error.
  os_username:
    type: string
    default: null
    description: EXPERIMENTAL. OpenStack Swift username.
  os_password:
    type: string
    default: null
    description: EXPERIMENTAL. OpenStack Swift password.
  os_auth_url:
    type: string
    default: null
    description: EXPERIMENTAL. OpenStack Swift authentication URL.
  os_tenant_name:
    type: string
    default: null
    description: EXPERIMENTAL. OpenStack Swift tenant name.
  aws_access_key_id:
    type: string
    default: null
    description: EXPERIMENTAL. Amazon AWS access key id.
  aws_secret_access_key:
    type: string
    default: null
    description: EXPERIMENTAL. Amazon AWS secret access key.
  wabs_account_name:
    type: string
    default: null
    description: EXPERIMENTAL. Windows Azure account name.
  wabs_access_key:
    type: string
    default: null
    description: EXPERIMENTAL. Windows Azure access key.
  package_status:
    default: "install"
    type: string
    description: |
        The status of service-affecting packages will be set to this
        value in the dpkg database. Useful valid values are "install"
        and "hold".
  # statsd-compatible metrics
  metrics_target:
    default: ""
    type: string
    description: |
        Destination for statsd-format metrics, format "host:port". If
        not present and valid, metrics disabled.
  metrics_prefix:
    default: "dev.$UNIT.postgresql"
    type: string
    description: |
        Prefix for metrics. Special value $UNIT can be used to include the
        name of the unit in the prefix.
  metrics_sample_interval:
    default: 5
    type: int
    description: Period for metrics cron job to run in minutes