"Stéphane A. Schildknecht" stephane.schildknecht at postgresql.fr
Mon Feb 27 06:02:09 PST 2012
Le 20/02/2012 18:56, Efraín Déctor a écrit :
> Delete the _EOF_ at the end of the script.
> 
> -----Mensaje original----- 
> From: NewToSlony
> Sent: Monday, February 20, 2012 10:45 AM
> To: slony1-general at lists.slony.info
> Subject: [Slony1-general] Syntax error?
> 
> 
> Hi,
> 
> I'm trying to use the example in the 2.1.1 documentation but I keep getting
> a syntax error.  I've noted that the doc shows
> cluster name = $CLUSTERNAME;
> is a valid syntax but unless I change the $ to a @ I get a syntax error,
> thus as I'm new and unsure I don't know if there are errors in the
> documentation or something I am missing.  Never the less, my script as as
> follows:
> 
> 
> #!/bin/sh
> 
> CLUSTERNAME= slony_example;
> /opt/local/lib/postgresql90/bin/slonik <<_EOL_
> define CLUSTERNAME slony_example;
> cluster name = @CLUSTERNAME;
> node 1 admin conninfo = 'dbname=my_primary host=localhost user=user';
> node 2 admin conninfo = 'dbname=my_rep host=localhost user=user';
> #-- 
> # init the first node. Its id MUST be 1. This creates the schema #
> _$CLUSTERNAME containing all replication system specific database # objects.
> #-- 
> init cluster ( id=1, comment='Master Node');
> #--
> # Slony-I organizes tables into sets. The smallest unit a node can #
> subscribe is a set. The following commands create one set containing # all 4
> pgbench tables. The master or origin of the set is node 1.
> #-- 
> create set (id=1, origin=1, comment='All pgbench tables');
> set add table (set id=1, origin=1, id=1, fully qualified
> name='public.pgbench_accounts', comment='accounts table');
> set add table (set id=1, origin=1, id=2, fully qualified
> name='public.pgbench_branches', comment='branches table');
> set add table (set id=1, origin=1, id=3, fully qualified
> name='public.pgbench_tellers', comment='tellers table');
> set add table (set id=1, origin=1, id=4, fully qualified
> name='public.pgbench_history', comment='history table');
> #-- 
> # Create the second node (the slave) tell the 2 nodes how to connect to
> Slony-I 2.1.1 Documentation 10 / 163
> # each other and how they should listen for events.
> #--
> store node (id=2, comment = 'Slave node', event node=1);
> store path (server = 1, client = 2, conninfo='dbname=my_primary
> host=localhost user=user');
> store path (server = 2, client = 1, conninfo='dbname=my_rep host=localhost
> user=user');
> _EOF_
> 
> 
> Yet I get the following syntax error:
> 
> 
> /tmp/slonik_example.sh: line 3: slony_example: command not found
> <stdin>:24: ERROR: syntax error at or near _EOF_
> 

You started with _EOL_.
You then have to end with the same mark, instead of the _EOF_ you used at the end.

-- 
Stéphane Schildknecht
http://www.Loxodata.com
Contact régional PostgreSQL
http://bistri.me/sas



More information about the Slony1-general mailing list