Thu Feb 19 09:26:41 PST 2009
- Previous message: [Slony1-general] Replication of a whole DB
- Next message: [Slony1-general] pkeyedtables and sequences
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"=?UTF-8?B?TWFydMOtbiBNYXJxdcOpcw==?=" <martin.marques at gmail.com> writes: > Is there any easier/faster way of configuring Slony for replication of > a whole DB? The DB we are going to replicate has 3 schemas, 73 tables > and 111 sequences. It's gonna be a long slon_tools.conf file. :-( I'd do it as follows: TABLES=`psql -d mydatabase -At -c "select quote_ident(table_schema) || '.' || quote_ident(table_name) from information_schema.tables where table_type = 'BASE TABLE' and table_schema not in ('pg_catalog', 'information_schema');"` SEQUENCES=`psql -d mydatabase -At -c "select quote_ident(sequence_schema) || '.' || quote_ident(sequence_name) from information_schema.sequences where sequence_schema not in ('pg_catalog', 'information_schema');"` sh tools/configure-replication.sh ./configure-replication.sh has generated Slony-I slonik scripts to initialize replication for SlonyTest. Cluster name: PG83 Number of nodes: 2 Scripts are in /tmp/slonytest-temp.idUrMP ===================== total 44 -rw-r--r-- 1 chris chris 165 2009-02-19 12:21 create_nodes.slonik -rw-r--r-- 1 chris chris 24609 2009-02-19 12:21 create_set.slonik -rw-r--r-- 1 chris chris 184 2009-02-19 12:21 preamble.slonik -rw-r--r-- 1 chris chris 255 2009-02-19 12:21 store_paths.slonik -rw-r--r-- 1 chris chris 113 2009-02-19 12:21 subscribe_set_2.slonik ===================== Be sure to verify that the contents of /tmp/slonytest-temp.idUrMP/preamble.slonik very carefully, as the configuration there is used widely in the other scripts. ===================== That generated the slonik scripts described, and, as you can see by the size of create_set.slonik, I had quite a few tables in that database! :-) See tools/configure-replication.txt for more notes on the (many!) additional options that can be set. I decline to add functionality into slonik or the Slony-I engine that can, as is shown above, may be accomplished using the existing tools via ONE SINGLE LINE of shell script. (I admit it's a pretty long line! ;-)) -- select 'cbbrowne' || '@' || 'cbbrowne.com'; http://linuxdatabases.info/info/linuxdistributions.html Who wants to remember that escape-x-alt-control-left shift-b puts you into super-edit-debug-compile mode? (Discussion in comp.os.linux.misc on the intuitiveness of commands, especially Emacs.)
- Previous message: [Slony1-general] Replication of a whole DB
- Next message: [Slony1-general] pkeyedtables and sequences
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list