pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to configure two netcard for PostgreSQL?
9+ messages / 5 participants
[nested] [flat]

* How to configure two netcard for PostgreSQL?
@ 2003-03-28 02:35 dailiming <ldai@accunettech.com>
  2003-03-28 05:43 ` Re: How to configure two netcard for PostgreSQL? Popeanga Marian <pmarian@cnlo.ro>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 9+ messages in thread

From: dailiming @ 2003-03-28 02:35 UTC (permalink / raw)
  To: Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; +Cc: pgsql-sql

Hi,everybody:
    Today ,I have met a problem.
    I have two netcard. One is eth0 192.168.1.10/255.255.255.0
the other is eth1 192.168.0.10/255.255.255.0

    When I conenct database use "psql -h 192.168.0.10 cityDB" , I cann't connect database.
    When I connect database use "psql -h 192.168.1.10 cityDB", I can connect database.

    In fact ,I want to connect database through the two netcard. What should I do for finishing the idea ?

Please help.
thanks.

leon
2003/03/28


^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
@ 2003-03-28 05:43 ` Popeanga Marian <pmarian@cnlo.ro>
  1 sibling, 0 replies; 9+ messages in thread

From: Popeanga Marian @ 2003-03-28 05:43 UTC (permalink / raw)
  To: dailiming <ldai@accunettech.com>; +Cc: Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

Try first to ping both addresses.
You need to add routing for your both ip classes.
Why not use those two net cards in the same address class ?

dailiming wrote:

>Hi,everybody:
>    Today ,I have met a problem.
>    I have two netcard. One is eth0 192.168.1.10/255.255.255.0
>the other is eth1 192.168.0.10/255.255.255.0
>
>    When I conenct database use "psql -h 192.168.0.10 cityDB" , I cann't connect database.
>    When I connect database use "psql -h 192.168.1.10 cityDB", I can connect database.
>
>    In fact ,I want to connect database through the two netcard. What should I do for finishing the idea ?
>
>Please help.
>thanks.
>
>leon
>2003/03/28
>
>---------------------------(end of broadcast)---------------------------TIP 3: if posting/reading through Usenet, please send an appropriatesubscribe-nomail command to majordomo@postgresql.org so that yourmessage can get through to the mailing list cleanly
>
>  
>

-- 
Popeanga Marian
DBA Oracle
CNLO Romania




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
@ 2003-03-28 13:56 ` Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Peter Eisentraut @ 2003-03-28 13:56 UTC (permalink / raw)
  To: dailiming <ldai@accunettech.com>; +Cc: Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

dailiming writes:

>     In fact ,I want to connect database through the two netcard. What should I do for finishing the idea ?

Read the chapter on client authentication.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
@ 2003-03-31 01:00   ` dailiming <ldai@accunettech.com>
  2003-03-31 02:15     ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: dailiming @ 2003-03-31 01:00 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

Yes, I have already set the two Ip address in the pg_hba.conf file .
But It do nothing.
So I htought adding some messages in the router table may be a way.

Thanks.

----- Original Message ----- 
From: "Peter Eisentraut" <peter_e@gmx.net>
To: "dailiming" <ldai@accunettech.com>
Cc: "Bruno Wolff III" <bruno@wolff.to>; "Rudi Starcevic" <rudi@oasis.net.au>; <pgsql-sql@postgresql.org>
Sent: Friday, March 28, 2003 9:56 PM
Subject: Re: [SQL] How to configure two netcard for PostgreSQL?


> dailiming writes:
> 
> >     In fact ,I want to connect database through the two netcard. What should I do for finishing the idea ?
> 
> Read the chapter on client authentication.
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 


^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
@ 2003-03-31 02:15     ` Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 02:51       ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2003-03-31 02:15 UTC (permalink / raw)
  To: dailiming <ldai@accunettech.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

"dailiming" <ldai@accunettech.com> writes:
> Yes, I have already set the two Ip address in the pg_hba.conf file .
> But It do nothing.

No, what you need is to put in the addresses or address ranges of all
the machines that will connect through either net card.  (And don't
forget to SIGHUP the postmaster after you change its config file.)

The fact that there are multiple net cards doesn't matter at all;
Postgres should bind to its port number on each of the machine's IP
addresses, automatically.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-31 02:15     ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-03-31 02:51       ` dailiming <ldai@accunettech.com>
  2003-03-31 04:41         ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 06:30         ` Re: How to configure two netcard for PostgreSQL? Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 2 replies; 9+ messages in thread

From: dailiming @ 2003-03-31 02:51 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

I try again. 
F.E:
First,I modified the pg_hba.conf cfg file.

host all 192.168.0.10 255.255.255.0 trust
host all 192.168.1.10 255.255.255.0 trust

Second, I used "/etc/rc.d/init.d/postgresql" to stopping the postmaster.
Finally, I restart the postmaster by "/usr/bin/postmaster -i -S -D /var/lib/pgsql/lib/data".

When I telnet 192.168.0.10 to connect database,I have the same results as before.

"psql -h 192.168.0.10 coredb  " is failed.
"psql -h 192.168.1.10 coredb "  is successed.

Why the first is failed?


thanks.

----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "dailiming" <ldai@accunettech.com>
Cc: "Peter Eisentraut" <peter_e@gmx.net>; "Bruno Wolff III" <bruno@wolff.to>; "Rudi Starcevic" <rudi@oasis.net.au>; <pgsql-sql@postgresql.org>
Sent: Monday, March 31, 2003 10:15 AM
Subject: Re: [SQL] How to configure two netcard for PostgreSQL? 


> "dailiming" <ldai@accunettech.com> writes:
> > Yes, I have already set the two Ip address in the pg_hba.conf file .
> > But It do nothing.
> 
> No, what you need is to put in the addresses or address ranges of all
> the machines that will connect through either net card.  (And don't
> forget to SIGHUP the postmaster after you change its config file.)
> 
> The fact that there are multiple net cards doesn't matter at all;
> Postgres should bind to its port number on each of the machine's IP
> addresses, automatically.
> 
> regards, tom lane
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 


^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-31 02:15     ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 02:51       ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
@ 2003-03-31 04:41         ` Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 05:28           ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Tom Lane @ 2003-03-31 04:41 UTC (permalink / raw)
  To: dailiming <ldai@accunettech.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

"dailiming" <ldai@accunettech.com> writes:
> host all 192.168.0.10 255.255.255.0 trust
> host all 192.168.1.10 255.255.255.0 trust

Nonzeroes in the address where there are zeroes in the mask is a loser.
Try

host all 192.168.0.0 255.255.255.0 trust
host all 192.168.1.0 255.255.255.0 trust

Of course, you could replace both of these lines with

host all 192.168.0.0 255.255.254.0 trust

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-31 02:15     ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 02:51       ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-31 04:41         ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-03-31 05:28           ` dailiming <ldai@accunettech.com>
  0 siblings, 0 replies; 9+ messages in thread

From: dailiming @ 2003-03-31 05:28 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Bruno Wolff III <bruno@wolff.to>; Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql

Thank you very much.
I successed.
But I have a question. Why do I set  the single Ip address in pg_hba.conf that is failed?
Could you explain for me?
Thank your help.

----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "dailiming" <ldai@accunettech.com>
Cc: "Peter Eisentraut" <peter_e@gmx.net>; "Bruno Wolff III" <bruno@wolff.to>; "Rudi Starcevic" <rudi@oasis.net.au>; <pgsql-sql@postgresql.org>
Sent: Monday, March 31, 2003 12:41 PM
Subject: Re: [SQL] How to configure two netcard for PostgreSQL? 


> "dailiming" <ldai@accunettech.com> writes:
> > host all 192.168.0.10 255.255.255.0 trust
> > host all 192.168.1.10 255.255.255.0 trust
> 
> Nonzeroes in the address where there are zeroes in the mask is a loser.
> Try
> 
> host all 192.168.0.0 255.255.255.0 trust
> host all 192.168.1.0 255.255.255.0 trust
> 
> Of course, you could replace both of these lines with
> 
> host all 192.168.0.0 255.255.254.0 trust
> 
> regards, tom lane
> 


^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: How to configure two netcard for PostgreSQL?
  2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-28 13:56 ` Re: How to configure two netcard for PostgreSQL? Peter Eisentraut <peter_e@gmx.net>
  2003-03-31 01:00   ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
  2003-03-31 02:15     ` Re: How to configure two netcard for PostgreSQL? Tom Lane <tgl@sss.pgh.pa.us>
  2003-03-31 02:51       ` Re: How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
@ 2003-03-31 06:30         ` Tomasz Myrta <jasiek@klaster.net>
  1 sibling, 0 replies; 9+ messages in thread

From: Tomasz Myrta @ 2003-03-31 06:30 UTC (permalink / raw)
  To: dailiming <ldai@accunettech.com>; +Cc: pgsql-sql

Uz.ytkownik dailiming napisa?:
> I try again. 
> F.E:
> First,I modified the pg_hba.conf cfg file.
> 
> host all 192.168.0.10 255.255.255.0 trust
> host all 192.168.1.10 255.255.255.0 trust
> 
> Second, I used "/etc/rc.d/init.d/postgresql" to stopping the postmaster.
> Finally, I restart the postmaster by "/usr/bin/postmaster -i -S -D /var/lib/pgsql/lib/data".
> 
> When I telnet 192.168.0.10 to connect database,I have the same results as before.
> 
> "psql -h 192.168.0.10 coredb  " is failed.
> "psql -h 192.168.1.10 coredb "  is successed.
> 
> Why the first is failed?


I have postgres 7.3. I tested your case on ip-alias on only one netcard
and it works fine.
Maybe you have some routing problems? Can you ping both netcards?

Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2003-03-31 06:30 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-28 02:35 How to configure two netcard for PostgreSQL? dailiming <ldai@accunettech.com>
2003-03-28 05:43 ` Popeanga Marian <pmarian@cnlo.ro>
2003-03-28 13:56 ` Peter Eisentraut <peter_e@gmx.net>
2003-03-31 01:00   ` dailiming <ldai@accunettech.com>
2003-03-31 02:15     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-03-31 02:51       ` dailiming <ldai@accunettech.com>
2003-03-31 04:41         ` Tom Lane <tgl@sss.pgh.pa.us>
2003-03-31 05:28           ` dailiming <ldai@accunettech.com>
2003-03-31 06:30         ` Tomasz Myrta <jasiek@klaster.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox