@@ -318,6 +318,18 @@ Replace `<HOST>` with the DB server's hostname. Replace `<PORT>` with
318318the port on which PostgreSQL is listening. Replace ` <DATABASE> ` with
319319the name of the database you've created for use with PuppetDB.
320320
321+ With this arrangemnt, PuppetDB will use the specified database for all
322+ operations (storage and queries), but PuppetDB supports other
323+ arrangments. It's possible to
324+ [ specify a different read-only database] ( #[read-database]--settings )
325+ to among other things, handle queries, and provide responses for
326+ PuppetDB's [ peer-to-peer synchronization process] ( #sync--settings ) .
327+
328+ It's also possible to specify [ multiple storage databases] ( #broadcasting-commands )
329+ to which PuppetDB will attempt delivery of incoming information on a
330+ best-effort basis. Note that any given PuppetDB instance can have
331+ sync enabled or command broadcast, but not both.
332+
321333#### Using SSL With PostgreSQL
322334
323335It's possible to use SSL to protect connections to the database. There
@@ -394,6 +406,51 @@ Then specify `puppetdb_migrator` as the
394406See the [ migration coordination documentation] ( migration_coordination )
395407for a more detailed explanation of the process.
396408
409+ #### Broadcasting commands to multiple databases
410+
411+ PuppetDB can be configured to attempt to send each command to multiple
412+ databases on a best-effort basis. There are no guarantees that any
413+ given command will reach all of the databases, so the process is
414+ inherently "lossy". At the moment PuppetDB will consider a command to
415+ be successfully processed as soon as it manages to send the command to
416+ at least one of the databases. Note that currently, a server cannot
417+ be configured to broadcast and [ sync] ( #sync--settings ) .
418+
419+ To enable broadcast, create one ` [database-NAME] ` subsection for each
420+ database. For example, to attempt to send commands to a primary and
421+ secondary database, you could add something like this to your
422+ configuration:
423+
424+ [database]
425+ # When subsections are defined, unset values in any subsection will
426+ # default to the values set here.
427+ subname = //host1:5432/puppetdb
428+ username = <USERNAME1>
429+ password = <PASSWORD1>
430+ # Currently required
431+ migrate = false
432+
433+ [database-primary]
434+ # Settings intentionally omitted.
435+ # Unset values default to those in [database]
436+
437+ [database-secondary]
438+ subname = //host2:5432/puppetdb
439+ username = <USERNAME2>
440+ password = <PASSWORD2>
441+
442+ When subsections are defined, the ` [database] ` section provides
443+ defaults that will apply whenever a value is not specified in a
444+ subsection. These defaults will also be used for the read database
445+ whenever an explict [ ` [read-database] ` ]] ( #[read-database]--settings )
446+ isn't provided.
447+
448+ PuppetDB currently migrates multiple write databases one at a time.
449+ If you'd prefer more control over the process you can migrate
450+ databases individually by running `puppetdb upgrade -c
451+ just-one-db.ini` for each database and making sure that each command
452+ exits successfully (with non-zero status).
453+
397454### ` gc-interval `
398455
399456This controls how often, in minutes, to compact the database. The
@@ -579,24 +636,27 @@ suggesting appropriate action. If set to zero, this check is disabled.
579636-----
580637
581638The ` [read-database] ` section configures PuppetDB's _ read-database_
582- settings, useful when running a PostgreSQL [ Hot
583- Standby] ( http://wiki.postgresql.org/wiki/Hot_Standby ) cluster.
584- Currently, only configuring a PostgreSQL read-database is supported. See
585- the PostgreSQL documentation [ here] ( http://wiki.postgresql.org/wiki/Hot_Standby )
586- for details on configuring the cluster. The ` [read-database] ` portion
587- of the configuration is in addition to the ` [database] ` settings. If
588- ` [read-database] ` is specified, ` [database] ` must also be specified.
639+ settings, which can be useful if you have
640+ [ set up a PostgreSQL Hot Standby] ( http://wiki.postgresql.org/wiki/Hot_Standby )
641+ cluster.
642+
643+ Whenever a ` [read-database] ` is specified, a ` [database] ` must also be
644+ specified to provide a write database. Whenever a ` [read-database] `
645+ is not specified, the relevant read operations will be directed to the
646+ database specified in the ` [database] ` section, which must have all
647+ the required settings (i.e. any database subsections are irrelevant).
589648
590- To configure PuppetDB to use a read-only database from the cluster,
591- add the following to the ` [read-database] ` section :
649+ To configure PuppetDB to use a read-only database from a hot standby
650+ cluster, add the following to the configuration :
592651
652+ [read-database]
593653 subname = //<HOST>:<PORT>/<DATABASE>
594654 username = <USERNAME>
595655 password = <PASSWORD>
596656
597- Replace ` <HOST> ` with the DB server's hostname. Replace ` <PORT> ` with
598- the port on which PostgreSQL is listening. Replace ` <DATABASE> ` with
599- the name of the database you've created for use with PuppetDB.
657+ Replace ` <HOST> ` with the DB server's hostname, ` <PORT> ` with the port
658+ on which PostgreSQL is listening, and ` <DATABASE> ` with the name of
659+ the database you've created for PuppetDB.
600660
601661#### Using SSL With PostgreSQL
602662
0 commit comments