1
- DBMirror - Postgres Database Mirroring
1
+ DBMirror - PostgreSQL Database Mirroring
2
2
===================================================
3
3
4
4
5
- DBMirror is a database mirroring system developed for the Postgres
5
+ DBMirror is a database mirroring system developed for the PostgreSQL
6
6
database Written and maintained by Steven Singer(ssinger@navtechinc.com)
7
7
8
8
@@ -54,6 +54,13 @@ If the transaction has been sent to all know slave hosts (All entries
54
54
in the MirrorHost table) then all records of it are purged from the
55
55
Pending tables.
56
56
57
+ Requirments:
58
+ ---------------------------------
59
+ -PostgreSQL-7.4 (Older versions are no longer supported)
60
+ -Perl 5.6(Other versions might work)
61
+ -PgPerl (http://gborg.postgresql.org/project/pgperl/projdisplay.php)
62
+
63
+
57
64
Installation Instructions
58
65
------------------------------------------------------------------------
59
66
@@ -66,33 +73,11 @@ time a row inside of a table being mirrored changes.
66
73
67
74
To build the trigger run make on the "Makefile" in the DBMirror directory.
68
75
69
- Postgres-7.3 & 7.4 Make Instructions:
76
+ PostgreSQL- 7.4 Make Instructions:
70
77
71
78
If you have already run "configure" in the pgsql-server directory
72
79
then run "make" in the dbmirror directory to compile the trigger.
73
80
74
- Postgres-7.1 & Postgres-7.2 Make Instructions:
75
-
76
- The included Makefile is not compatible with postgres 7.1 and 7.2
77
- The trigger will need to be built by hand.
78
-
79
- Run the following commands
80
-
81
- gcc -fpic -I/usr/local/pgsql/include/server -c pending.c -DNOSCHEMAS -DNODROPCOLUMN
82
- ld -shared -o pending.so pending.o
83
-
84
- Assuming the postgres include files are in /usr/local/pgsql/include/server.
85
-
86
- Postgres-7.1.x installations should change this to
87
- /usr/local/pgsql/include (The server part is for 7.2+)
88
-
89
- If you have installed the postgres include files to another location then
90
- modify the include path to reflect this.
91
-
92
- Compiling the trigger by hand requires that all postgres headers be installed
93
- ,this is accomplished in postgresql(7.1 or 7.2) by running
94
- "make install-all-headers" in the postgres source directory.
95
-
96
81
97
82
You should now have a file named pending.so that contains the trigger.
98
83
@@ -109,7 +94,7 @@ choose to install the trigger elsewhere.
109
94
This file contains SQL commands to setup the Mirroring environment.
110
95
This includes
111
96
112
- -Telling Postgres about the "recordchange" trigger function.
97
+ -Telling PostgreSQL about the "recordchange" trigger function.
113
98
-Creating the Pending,PendingData, MirrorHost, MirroredTransaction tables
114
99
115
100
@@ -120,15 +105,6 @@ To execute the script use psql as follows
120
105
where MyDatabaseName is the name of the database you wish to install mirroring
121
106
on(Your master).
122
107
123
- Postgres-7.1 and 7.2 Notes:
124
- -The syntax for creating a trigger function changed in Postgres-7.3.
125
- Change the line in MirrorSetup.sql from
126
-
127
- CREATE FUNCTION "recordchange" () RETURNS trigger AS
128
-
129
- to
130
- CREATE FUNCTION "recordchange" () RETURNS OPAQUE AS
131
-
132
108
133
109
3) Create slaveDatabase.conf files.
134
110
@@ -185,8 +161,7 @@ INSERT INTO "MirrorHost" ("HostName") VALUES ('mySlaveMachine.mycompany.com');
185
161
186
162
DBMirror.pl is the perl script that handles the mirroring.
187
163
188
- It requires the Perl library Pg(See src/interfaces/perl5 in the postgres
189
- source distribution).
164
+ It requires the Perl library Pg(See http://gborg.postgresql.org/project/pgperl/projdisplay.php)
190
165
191
166
It takes its configuration file as an argument(The one from step 3)
192
167
One instance of DBMirror.pl runs for each slave machine that is receiving
@@ -223,22 +198,6 @@ TODO(Current Limitations)
223
198
-Batching SQL commands in DBMirror for better performance over WAN's.
224
199
-Better support for dealing with Schema changes.
225
200
226
- Tested Platforms:
227
- ------------------
228
-
229
- DBMirror has been tested on the following configurations but should
230
- work on any platform with Postgres >= 7.1 and Perl 5.6.
231
-
232
- RedHat Linux 7.1 & 6.2
233
- -Postgres 7.1.2
234
- -Perl 5.6
235
-
236
- Mandrake Linux 8.0(Limited Testing)
237
- -Postgres 7.2
238
- -Postgres 7.3
239
- -Postgres 7.4
240
- -Perl 5.6
241
-
242
201
243
202
Steven Singer
244
203
Navtech Systems Support Inc.
0 commit comments