Posts Tagged ‘RelStorage’

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

This post is asked by a friend of mine, Vincenzo Di Somma, from Canonical and he was very surprised to see an oracle db on a small netbook. In reality, it is very simple.

What you need is a netbook with 1.5GB of free space on disk. I suggest 2GB of ram too.  I make setup on ubuntu 9.04, but it works on any linux distro.

First of all, we need oracle. There’s a free version for developer called Oracle XE. This version is smaller and simpler than the full version, but the interface is the same, so if you have to develop without licence problem this is your version.

Once you have download the file, you can follow usual way to install it.

During the installation, setup asks about user and password access, obviously you can choice what you want.

The game is done.

You can access to oracle XE by web client or using another kind of client. In my case study, I used RelStorage to substitute FileStorage of Plone, but this is another story 🙂 .