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
|
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: ""
type: string
description: Version of PostgreSQL that we want to install
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: 5432
type: int
description: Port to listen on
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_line_prefix:
default: "%t "
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.
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: |
Hot standby or warm standby. When True, queries can be run against
the database when in recovery or standby mode (ie. replicated).
Overridden by juju when master/slave relations are used.
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 s 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
maintenance_work_mem:
default: "1MB"
type: string
description: Maintenance working memory
performance_tuning:
default: "auto"
type: string
description: |
Possible values here are "auto" or "manual". If we set "auto" then the
charm will attempt to automatically tune all the performance parameters
for kernel_shmall, kernel_shmmax, shared_buffers and
effective_cache_size below, unless those config values are explicitly
set. If manual, then it will use the defaults below unless set.
"auto" 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'.
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'.
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)
checkpoint_segments:
default: 3
type: int
description: in logfile segments, min 1, 16MB each
random_page_cost:
default: 4.0
type: float
description: Random page cost
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.
extra_archives:
default: ""
type: string
description: |
Extra archives to add, space separated. Supports ppa:, http:, cloud:
URIs, as well as other schemes and keywords supported by
charmhelpers.fetch.add_source() such as "proposed".
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.
storage_mount_point:
default: "/mnt/storage"
type: string
description: |
The location where the storage is going to be mounted.
# Swift backups and PITR via SwiftWAL
swiftwal_container_prefix:
type: string
default: ""
description: |
EXPERIMENTAL.
Swift container prefix for SwiftWAL to use. Must be set if any
SwiftWAL features are enabled.
swiftwal_backup_schedule:
type: string
default: ""
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,
this 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.
streaming_replication:
type: boolean
default: true
description: |
EXPERIMENTAL.
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: ""
description: EXPERIMENTAL. OpenStack Swift username.
os_password:
type: string
default: ""
description: EXPERIMENTAL. OpenStack Swift password.
os_auth_url:
type: string
default: ""
description: EXPERIMENTAL. OpenStack Swift authentication URL.
os_tenant_name:
type: string
default: ""
description: EXPERIMENTAL. OpenStack Swift tenant name.
|