Message-ID: <1095635555.40804.1371624150323.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_40803_2101933815.1371624150322" ------=_Part_40803_2101933815.1371624150322 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This document should get you up and running with a replicated PostgreSQL= database in just a few steps. We'll gloss over many details in the intere= st of getting you up and running as quickly as possible. To make things si= mple, this document will use the sample cluster configuration found in the = "bruce/sample" directory of the distribution. The example uses a= single PostgreSQL installation with 4 databases.
bruce_config- This database contains the cluster confi= guration metadata. This includes cluster names and identifiers, master dat= abase uri's and descriptive names, slave database uri's and descriptive nam= es, and regular expression patterns to determine which tables are replicate= d.
bruce_master- The master database. All modifications = to replicated tables are made to this database and subsequently replicated = to each slave.
bruce_slave_1- A slave database. All modifications to= the master database are replicated here.
bruce_slave_2- A slave database. All modifications to= the master database are replicated here.
The master and each slave have a
replication_test schema an=
replication_test.replicate_this table that we will replica=
te across the cluster.
Note: This demonstration makes the assumption that = all replicated clusters in the schema contain identical data.
The steps in this guide are loosely followed in test/src/com/netblue/bru= ce/SetupClusterFromExistingDbAcceptanceTest.java
tar xvzf bruce-0.1a.tgz
chmod 755 *.sh
vi config.xml(change db urls to point to your database= s for each node)
./admin.sh -data ../sample/config.xml -initnodeschema -initsna= pshots MASTER -loadschema -operation CLEAN_INSERT -url jdbc:postgresql://lo= calhost:5432/bruce_config?user=3Dbruce -pass bruce
-data ../sample/config.xml tells us what data file to load. the sample = file contains 1 master and 2 slaves with replication patterns to recognize = the replication_test.* tables.
-initnodeschema tells us to install the replication schema on each node,= along with the triggers for each replicated table. If the schema is alrea= dy installed, then only the replication triggers are installed for each rep= licated table. For master nodes, if there is no data in the snapshotlog ta= ble (as in this case) a snapshot of the db is taken.
-initsnapshots MASTER tells us to set the slave snapshot status to the l= ast snapshot in the master database. Since the -initnodeschema option init= ializes this for us, we'll use that.
-loadschema tells us to install the replication node topology schema on = the configuration database. This is only really useful the first time you = run the admin tool for a given configuration database.
-operation CLEAN_INSERT tells us to drop everything from the node topolo= gy configuration database before inserting these new nodes
-url is the URL for the configuration database
-pass is the password for the configuration database