PostgreSQL XC defined resource types




8,902 latest version

1.9 quality score

Version information

  • 0.0.1 (latest)
released Jan 22nd 2014

Start using this module


jormandy/postgresqlxc — version 0.0.1 Jan 22nd 2014


Table of Contents

  1. Overview
  2. Module Description
  3. Usage
  4. Limitations
  5. TODO


The PostgreSQL XC module allows you to easily install and manage Postgres XC databases with Puppet.

Module Description

Postgresql-XC is a synchronous multi-master Postgresql cluster solution. Full details can be found on the home page.


Postgresql-XC is set up into four basic components; coordinator, datanode, gtm and gtm-proxy.

In a single server set up, such as described in the documentation: You could create a gtm, coordinator and two datanodes on the same server like this:

Create the GTM class {'postgresqlxc::gtm': node_name => 'one' }

$coordinator_postgresql_params = { pgxc_node_name => "'coord1'", gtm_host => $ipaddress, }

$pg_hba_params = [ ['host', 'replication', 'pgxc', 'x.x.x.x/24', 'trust'], ['host', 'all', 'all', 'x.x.x.x/24', 'trust'] ]

Create a Coordinator database class {'postgresqlxc::coordinator': node_name => 'coord1' , postgresql_params => $coordinator_postgresql_params, pg_hba_params => $pg_hba_params }

Create two Datanode databases $datanode_postgresql_params = { gtm_host => $ipaddress, listen_addresses => $ipaddress, port => 15432 }

$datanode2_postgresql_params = { gtm_host => $ipaddress, listen_addresses => $ipaddress, port => 25432 }

postgresqlxc::datanode {"datanode1": node_name => 'datanode1', postgresql_params => $datanode1_postgresql_params, pg_hba_params => $pg_hba_params }

postgresqlxc::datanode {"datanode2": node_name => 'datanode2', postgresql_params => $datanode2_postgresql_params, pg_hba_params => $pg_hba_params }

If all worked well, you should be able to create a database like this postgresqlxc::server::createdb {'ildb': db_name => 'ildb' , coordinator_postgresql_params => $coordinator_postgresql_params }

Order is important the coordinators need to be up and running before the datanodes come up.

Class['postgresqlxc::gtm_proxy'] -> Class['postgresqlxc::coordinator'] Class['postgresqlxc::coordinator'] -> Postgresqlxc::Datanode['datanode1'] -> Postgresqlxc::Datanode['datanode2'] -> Postgresqlxc::Server::Createdb['ildb']


Currently this solution has only been installed and tested on Redhat64 servers. And built using the RPMs createdb by stormdb, which can be found here:

With multiple servers you still need to register the remote coordinators and datanodes with each coordinator.


Where do we start?

  • Better handling of user and groups
  • Debian support
  • Ordering is important with Postgres-XC, how are we going to handle this over a multiple db setup
  • Uninstalling
  • Better support for creating databases.
  • Some variables in params.pp should be variables.
  • Tests
  • Work on the registration section
  • gtm_ctl init script seems to have a bug and expects /var/lib/psql to exists, needs further investigation