Craig James craig_james at emolecules.com
Wed Apr 2 22:29:41 PDT 2008
Jeff Frost wrote:
> On Wed, 2 Apr 2008, Craig James wrote:
> 
>> I keep getting this error:
>>
>>  remoteListenThread_1: db_getLocalNodeId() returned 2 - wrong database?
>>
>> I suspect the slon daemon can't handle port numbers correctly.  In 
>> this case, both the master and slave databases have the same name, AND 
>> the same host. The only difference is the port number.
>>
>> When I start slon, it seems to try to figure out the node number from 
>> the combination of dbname+host, but it seems to ignore the port 
>> number, so it arbitrarily will get node 1 or node 2.
>>
>> (In case you're wondering, the second database is actually on a 
>> different machine, accessed via an encrypted ssh(1) tunnel that maps 
>> port 5433 on the local machine to port 5432 on the remote machine.  So 
>> the two databases are accessed by the same name and same host, with 
>> only the port to distinguish them.)
>>
>> Is my analysis correct?  How does the slon daemon figure out which 
>> node number it is working on?  There doesn't seem to be any way to 
>> tell it.
> 
> It calls the getlocalnodeid(name) function on the DB specified in the 
> conninfo when it's started.
> 
> How are you providing the conninfo to the slon daemons?

The same string I used to create the nodes, for example, here are the master and slave, respectively:

  Node 1 (master): slon -d 1 my_db_cluster 'dbname=my_db host=au user=postgres port=5433'
  Node 2 (slave):  slon -d 1 my_db_cluster 'dbname=my_db host=au user=postgres'

I also tried to make up a dummy hostname "au2", just to make them look different.  After deleting both nodes and rebuilding them with the different server names:

  Node 1 (master): slon -d 1 my_db_cluster 'dbname=my_db host=au2 user=postgres port=5433'
  Node 2 (slave):  slon -d 1 my_db_cluster 'dbname=my_db host=au user=postgres'

but I still get the error.  This is a bit baffling.  I can't really see what's different than the other Slony configurations I've set up, other than that I've never used port numbers before.

Thanks,
Craig



More information about the Slony1-general mailing list