Plone, Relstorage, Repmgr and PostgreSQL

Posted: 19/07/2013 in Develop, System Administration
Tags: , , , , , , ,

Hi All,

In these days I studied about HA of Plone. Some years ago I tested the same things using Oracle in an Enterprise context, so with licenced support of Oracle. Oracle has a client called instantclient, who hide any problem about the presence of more than a dbserver, so relstorage makes no difference between a local db and a cluster. So it was very easy.

With Postgres there’s pgpool, a tool to make the same thing, but I want to take some time to study repmgr, some kind of wrapper around PostgreSQL Hot standby.

The configuration is not so complicated but a little bit long and I don’t want to repeat every step, so: this is the guide about configure repmgr and postgresql:

https://github.com/2ndQuadrant/repmgr/blob/master/autofailover_quick_setup.rst

About this guide, I have to say a couple of words:

  • promote_command.sh is never shown but it may be something like this:
#!/bin/bash
repmgr -f /etc/repmgr/repmgr.conf --verbose standby promote
/etc/init.d/postgresql restart
  • repmgr try to use pg_ctl: in debian this is not necessary available, so after clone command or promote (see before) is necessary to restart postgres by hand

If everything goes well, we now have 2 dbservers in Master/Slave mode using Streaming Replication. Well a few steps are necessary:

  • take a buildout for Plone: a new one or your favorite
  • locate the instance or the instances (sections with recipe plone.recipe.zope2instance)
  • add as usual, the relstorage support (be sure you get at least 1.5.1)
  • remove from DSN relstorage option, ‘host=…’
  • add option replica-conf (see relstorage documentation)
  • write a file in the root of buildout with the list of dbase ips, one for line
  • Buildout and enjoy

To get a really HA, you have to build at least two dbservers and two plone servers with public ip and a round robin DNS (are always in HA) to manage two or more ips for the same domain. To avoid the single point of failure is necessary to get a real HA.

Cheers

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s