Forge Home

pg_streaming_replication

Configures PostgreSQL streaming replication based on replication slots.

8,971 downloads

6,975 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Sep 1st 2017
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'fatdragon-pg_streaming_replication', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add fatdragon-pg_streaming_replication
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install fatdragon-pg_streaming_replication --version 0.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

fatdragon/pg_streaming_replication — version 0.1.1 Sep 1st 2017

pg_streaming_replication

The module configures and initiates PostgreSQL streaming replication based on replication slots. It is based on tutorial PostgreSQL HA with pgpool-II (or to be more precise on the first three parts of the tutorial).

It is an open source module, published under Apache 2.0 license and managed at Github. Contributors are welcome!

The complete tutorial is available here.

Basic Usage

Assuming that the servers that will participate in replication are:

  • 192.168.1.1 (primary)
  • 192.168.1.2 (standby)

the primary server can be initialized with something like:

class { 'pg_streaming_replication': 
  id_rsa_source        => 'puppet:///files/my_postgres_ssh_id_rsa', 
  id_rsa_pub_source    => 'puppet:///files/my_postgres_ssh_id_rsa.pub', 
  nodes                => ['192.168.1.1', '192.168.1.2'],
  replication_password => 'BDE4CE17-98E5-4FDC-B03C-B94559FE03D8', 
  initiate_role        => 'primary', 
}

while the standby server can be initialized with:

class { 'pg_streaming_replication': 
  id_rsa_source        => 'puppet:///files/my_postgres_ssh_id_rsa', 
  id_rsa_pub_source    => 'puppet:///files/my_postgres_ssh_id_rsa.pub', 
  nodes                => ['192.168.1.1', '192.168.1.2'],
  replication_password => 'BDE4CE17-98E5-4FDC-B03C-B94559FE03D8', 
  initiate_role        => 'standby', 
  primary_server_ip    => '192.168.1.1', 
}

IMPORTANT NOTE: PostgreSQL replication is not a thing that you should configure by simply copying few lines of code. Although with the previous code you'll click-up replication - there's a lot more for you to learn and understand, so I strongly recommend going through the tutorials mentioned above. Even if you are experienced with replication you have to know what pg_streaming_replication module actually does.

Release History

v0.1.1

Date: September 1. 2017

Release Info:

  • Code cosmetics (thanks to puppet-lint).

v0.1.0

Date: Jun 7. 2016

Release Info:

  • Initial release.