Forge Home

postgresqlxc

PostgreSQL XC defined resource types

9,585 downloads

9,585 latest version

1.9 quality score

Version information

  • 0.0.1 (latest)
released Jan 22nd 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'jormandy-postgresqlxc', '0.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jormandy-postgresqlxc
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jormandy-postgresqlxc --version 0.0.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

jormandy/postgresqlxc — version 0.0.1 Jan 22nd 2014

puppet-postgresqlxc

Table of Contents

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

Overview

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.

Usage

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: http://postgres-xc.sourceforge.net/docs/1_1/install-short.html 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']

Limitations

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: http://yum.stormdb.com/repos/Postgres-XC.

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

TODO

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