Christopher Browne cbbrowne
Wed Aug 16 09:04:21 PDT 2006
Tilman Baumann <tilman.baumann at collax.com> writes:
> Hi,
>
> i'm building a setup for a database replication one master one client.
>
> I've not figured out really works. I changed the sampe from the install
> guide to fi my DB.
>
> And it seems to work. I have synced data on the client.
>
> But:
> I get this error on the client
>
> tilli at tilmanb:~$ slon licenseserver_cluster "dbname=licenseserver
> user=licenseserver host=localhost"
> 2006-08-16 13:34:19 CEST CONFIG main: slon version 1.1.5 starting up
> 2006-08-16 13:34:19 CEST CONFIG main: local node id = 2
> 2006-08-16 13:34:19 CEST CONFIG main: launching sched_start_mainloop
> 2006-08-16 13:34:19 CEST CONFIG main: loading current cluster configuration
> 2006-08-16 13:34:19 CEST CONFIG storeNode: no_id=1 no_comment='Master Node'
> 2006-08-16 13:34:19 CEST CONFIG storePath: pa_server=1 pa_client=2
> pa_conninfo="dbname=licenseserver host=localhost user=licenseserver"
> pa_connretry=10
> 2006-08-16 13:34:19 CEST CONFIG storeListen: li_origin=1 li_receiver=2
> li_provider=1
> 2006-08-16 13:34:19 CEST CONFIG storeSet: set_id=1 set_origin=1
> set_comment='Portal tables'
> 2006-08-16 13:34:19 CEST WARN   remoteWorker_wakeup: node 1 - no worker
> thread
> 2006-08-16 13:34:19 CEST CONFIG main: configuration complete - starting
> threads
> 2006-08-16 13:34:19 CEST DEBUG1 localListenThread: thread starts
> 2006-08-16 13:34:21 CEST CONFIG enableNode: no_id=1
> 2006-08-16 13:34:21 CEST DEBUG1 main: running scheduler mainloop
> 2006-08-16 13:34:21 CEST DEBUG1 remoteWorkerThread_1: thread starts
> 2006-08-16 13:34:21 CEST DEBUG1 remoteListenThread_1: thread starts
> 2006-08-16 13:34:21 CEST DEBUG1 cleanupThread: thread starts
> 2006-08-16 13:34:21 CEST DEBUG1 syncThread: thread starts
> 2006-08-16 13:34:21 CEST ERROR  remoteListenThread_1:
> db_getLocalNodeId() returned 2 - wrong database?
> 2006-08-16 13:34:33 CEST ERROR  remoteListenThread_1:
> db_getLocalNodeId() returned 2 - wrong database?
> 2006-08-16 13:34:44 CEST ERROR  remoteListenThread_1:
> db_getLocalNodeId() returned 2 - wrong database?
>
> The last line repeating over and over.
> No idea what this is about. Looks not good. :)

Probably not.

The trouble is probably with the contents of sl_path, and specifically
with the value of the conninfo, most precisely with the value
'host=localhost'.

Using 'localhost' only works if you have only one database server
where all the databases will live, which represents an assumption that
is only true when doing things like regression tests.

You need to specify 'host=[whatever is the real name/ip address of the server]'

Fixing this shouldn't be a big deal; you'd just need a slonik script
with, presumably, two revised STORE PATH statements with the conninfo
values fixed up to specify correct host addresses.

> The next thing i'm nost sure of is in which direction i need tcp
> connect to the db.  I would prefer if the client must not be able to
> connect to the master.  Would this work?  Can i push the data from
> the master or do they have cross-connections?

They need cross-connections.  In the case of a 2 node setup, you need
a complete set of connections.

If you had more nodes, it might be sensible to have *somewhat* limited
sets of connections, but it's still mandatory for there to be paths to
allow events to get from any one node in the cluster to any other
node.

> What i found anoying while seting it up was that i could not init a
> cluster with the same name after it failed the first time.
> Is there a nice way to whipe half initialized cluster definitions?

The slonik "UNINSTALL NODE" command would help...
http://linuxfinances.info/info/stmtuninstallnode.html

> And a note that you need superuser permissions on the tb and a note
> how to use .pgpass would be usefull.

The superuser issues are definitely addressed in the FAQ...
  http://linuxfinances.info/info/faq.html

As for .pgpass documentation, there is a nice page in the official
PostgreSQL documentation tree:
  http://www.postgresql.org/docs/8.1/static/libpq-pgpass.html
-- 
select 'cbbrowne' || '@' || 'ca.afilias.info';
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)



More information about the Slony1-general mailing list