allowing connections from additional hosts without a restart?

Started by Lonni J Friedmanover 21 years ago8 messagesgeneral
Jump to latest
#1Lonni J Friedman
netllama@gmail.com

Greetings,
Is it possible to allow TCP/IP connections from additional hosts (IPs)
without restarting postgresql?

The issue i'm having is that i've got a postgresql-7.4.6 box that has
a DB running on it for a j2ee based application on a separate server.
Now i need to add an additional DB for a different server, but I can't
afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

Is there any workaround that doesn't require a restart?

thanks!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama@gmail.com
LlamaLand http://netllama.linux-sxs.org

#2Frank D. Engel, Jr.
fde101@fjrhome.net
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You could always create and configure a new data directory, then start
a new instance of the postmaster running on a different port. Use the
new instance for the other client. That would separate the user
accounts, too...

On Jan 13, 2005, at 11:55 AM, Lonni J Friedman wrote:

Greetings,
Is it possible to allow TCP/IP connections from additional hosts (IPs)
without restarting postgresql?

The issue i'm having is that i've got a postgresql-7.4.6 box that has
a DB running on it for a j2ee based application on a separate server.
Now i need to add an additional DB for a different server, but I can't
afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

Is there any workaround that doesn't require a restart?

thanks!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama@gmail.com
LlamaLand http://netllama.linux-sxs.org

---------------------------(end of
broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if
your
joining column's datatypes do not match

- -----------------------------------------------------------
Frank D. Engel, Jr. <fde101@fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB5rcQ7aqtWrR9cZoRAmyZAJwNkk/b3QmgmKsoQpfAzdGEmhFjAwCZATtH
M77PWcaAyj5imsfPS9nBqXw=
=Prxi
-----END PGP SIGNATURE-----

___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com

#3Michael Fuhr
mike@fuhr.org
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

On Thu, Jan 13, 2005 at 08:55:08AM -0800, Lonni J Friedman wrote:

Is it possible to allow TCP/IP connections from additional hosts (IPs)
without restarting postgresql?

"pg_ctl reload" should cause the server to re-read its configuration
files without shutting down and restarting. See the section on
pg_ctl in the "PostgreSQL Server Applications" part of the documentation.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

Lonni J Friedman wrote:

Now i need to add an additional DB for a different server, but I
can't afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

pg_ctl reload or (equivalently) kill -HUP

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#5Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

On Thu, Jan 13, 2005 at 08:55:08AM -0800, Lonni J Friedman wrote:

The issue i'm having is that i've got a postgresql-7.4.6 box that has
a DB running on it for a j2ee based application on a separate server.
Now i need to add an additional DB for a different server, but I can't
afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

Is there any workaround that doesn't require a restart?

Sure. Send a SIGHUP to the postmaster. One easy way is

pg_ctl reload

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Porque Kim no hacia nada, pero, eso s�,
con extraordinario �xito" ("Kim", Kipling)

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

Lonni J Friedman <netllama@gmail.com> writes:

Is it possible to allow TCP/IP connections from additional hosts (IPs)
without restarting postgresql?

The issue i'm having is that i've got a postgresql-7.4.6 box that has
a DB running on it for a j2ee based application on a separate server.
Now i need to add an additional DB for a different server, but I can't
afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

SIGHUP (a/k/a pg_ctl reload) is sufficient for editing pg_hba.conf.

If you'd not had tcpip_socket enabled to start with, you would need a
restart to turn that on, but as long as the socket is there you are
good.

regards, tom lane

#7George Woodring
george.woodring@iglass.net
In reply to: Lonni J Friedman (#1)
Re: allowing connections from additional hosts without a restart?

I make the changes into the pg_hba.conf and do a kill -HUP 'PID' for
postgres to reread the file. The pid number can be found in the
~postgres/data/postmaster.pid file

Woody

IGLASS Networks
www.iglass.net

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Lonni J Friedman
Sent: Thursday, January 13, 2005 11:55 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] allowing connections from additional hosts without a
restart?

Greetings,
Is it possible to allow TCP/IP connections from additional hosts (IPs)
without restarting postgresql?

The issue i'm having is that i've got a postgresql-7.4.6 box that has a DB
running on it for a j2ee based application on a separate server.
Now i need to add an additional DB for a different server, but I can't
afford any down time to restart postgresql for the changes in pg_hba.conf to
take effect.

Is there any workaround that doesn't require a restart?

thanks!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama@gmail.com
LlamaLand http://netllama.linux-sxs.org

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

#8Lonni J Friedman
netllama@gmail.com
In reply to: Peter Eisentraut (#4)
Re: allowing connections from additional hosts without a restart?

Thanks to all who responded. That works perfectly.

On Thu, 13 Jan 2005 19:28:02 +0100, Peter Eisentraut <peter_e@gmx.net> wrote:

Lonni J Friedman wrote:

Now i need to add an additional DB for a different server, but I
can't afford any down time to restart postgresql for the changes in
pg_hba.conf to take effect.

pg_ctl reload or (equivalently) kill -HUP

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama@gmail.com
LlamaLand http://netllama.linux-sxs.org