So Sun Micrososystemsjust boughtMySQL. That could turn out to be pretty interesting.
In other news, Clustering and Replication. I've been setting up some highly available systems that need to use both MySQL and PostgreSQL. MySQL has some great options for this and I was able to pick between Master-Master replication (which was the final choice here) or a clustered storage engine, both of which are available from MySQL and are very straightforward to configure.
As for PostgreSQL, this is about the 2nd or 3rd time I've ever installed or used it, much less set it up to scale. (MySQL I've been using for ~10 years and with replication for at least a couple.) I assumed that replication would be as easy as MySQL and it turns out that it is, but there are a lot of 3rd party options that do different things and the documentation could be a lot more thorough. I stumbled across this article on PostgreSQL Replication and HA which led me to try out PGCluster. Your needs may vary, but this particular situation requires Master-Master replication with a definite upgrade path to High Availability. PGCluster seemed to provide all this, but it is non-trivial to get going. This PGCluster example was the most helpful thing I came across but it didn't really explain things too well, just provided a working configuration for a setup very different than mine. Read on for the details
First is getting this all installed on CentOS. PGCluster is not a daemon or tool, it's available as a patch to PostgreSQL or you can download a patched version which I chose to do.
yum install readline-devel
su - postgres
tar -zxf pgcluster-1.5.0rc16.tar.gz
chown -R postgres:postgres pgcluster-1.5.0-rc16
chown -R postgres /usr/local/pgsql
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
Then is the configuration files. This setup has host1 replicating to host2 as a backup. Make sure host1 and host2 are set up in DNS or /etc/hosts properly first!
That should be it! Any changes you make on either host will be replicated to the other in the "all servers and services up" mode. Insert/Update/etc queries on host2 will fail if host2 cannot get to the replication server, however select/etc queries on host2 will still work if the replication server is down. (The replication process is separate from the postgres process.)