#!/bin/sh
CLUSTER=sql_cluster
DB1=contactdb
DB2=contactdb_slave
H1=192.168.2.18
H2=192.168.2.13
U=postgres
slonik <<_EOF_
cluster name = $CLUSTER;
node 1 admin conninfo = 'dbname=$DB1 host=$H1 user=$U';
node 2 admin conninfo = 'dbname=$DB2 host=$H2 user=$U';
init cluster (id = 1, comment = 'Node 1');
create set (id = 1, origin = 1, comment = 'contact table');
set add table (set id = 1, origin = 1, id = 1, full qualified name = 'public.contact', comment = 'Table contact');
set add sequence (set id = 1, origin = 1, id = 2, full qualified name = 'public.contact_seq', comment = 'Sequence 
contact_seq');
store node (id = 2, comment = 'Node 2');
store path (server = 1, client = 2, conninfo = 'dbname=$DB1 host=$H1 user=$U');
store path (server = 2, client = 1, conninfo = 'dbname=$DB2 host=$H2 user=$U');
