How to check whether PostgreSQL server is up and running?

How to check whether PostgreSQL server is up and running?

am 08.05.2009 11:11:21 von Jan Muhammad

--0-2001070310-1241773881=:40203
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

After having various error message in starting PostgreSQL version 8.2.11; f=
inally uninstalled/deleted it. Now trying my luck on=A0 8.3.7, but things h=
aven't changed for me.
When I try to check that postmaster server is running or not? I get the fol=
lowing error:
$ postmaster -D /usr/local/pgsql/data
LOG:=A0 could not translate host name "localhost", service "5432" to addres=
s: Name or service not known
WARNING:=A0 could not create listen socket for "localhost"
FATAL:=A0 could not create any TCP/IP sockets
............................................................ ............
Similarly when I try to start postgres server with=20
[postgres@callisto postgresql-8.3.7]$ pg_ctl -D pg8 start
postgres cannot access the server configuration file "/usr/local/pgsql/post=
gresql-8.3.7/pg8/postgresql.conf": No such file or directory
server starting

Have no idea what's wrong and where the problem is? Do I need to change/edi=
t some of Environment variable settings or what? Or should I reinstall Post=
greSQL with Yum?? Or should give up using PostgreSQL and switch to some oth=
er DB like MySQL etc... No idea what to do.....?

Thanks in advance for help.

-Jan Muhammad

=0A
--0-2001070310-1241773881=:40203
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Hi,

After having various error message=
in starting PostgreSQL version 8.2.11; finally uninstalled/deleted it. Now=
trying my luck on  8.3.7, but things haven't changed for me.
When =
I try to check that postmaster server is running or not? I get the followin=
g error:
$ postmaster -D /usr/local/p=
gsql/data

LOG:  could not translate host name "localhost", s=
ervice "5432" to address: Name or service not known
WARNING:  could=
not create listen socket for "localhost"
FATAL:  could not create =
any TCP/IP sockets
.....................................................=
...................
Similarly when I try to start postgres server with r>[postgres@callisto postgresql-8.3.7]$ =
pg_ctl -D pg8 start

postgres cannot access the server configurati=
on file
"/usr/local/pgsql/postgresql-8.3.7/pg8/postgresql.conf": No such file or d=
irectory
server starting

Have no idea what's wrong and where the =
problem is? Do I need to change/edit some of Environment variable settings =
or what? Or should I reinstall PostgreSQL with Yum?? Or should give up usin=
g PostgreSQL and switch to some other DB like MySQL etc... No idea what to =
do.....?

Thanks in advance for help.

-Jan Muhammad

d>


--0-2001070310-1241773881=:40203--

Re: How to check whether PostgreSQL server is up and running?

am 08.05.2009 12:03:04 von Michael Monnerie

--nextPart2642362.779PJ5a6bj
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Freitag 08 Mai 2009 Jan Muhammad wrote:
> After having various error message in starting PostgreSQL version
> 8.2.11; finally uninstalled/deleted it. Now trying my luck on=A0 8.3.7,
> but things haven't changed for me. When I try to check that
> postmaster server is running or not? I get the following error: $
> postmaster -D /usr/local/pgsql/data
> LOG:=A0 could not translate host name "localhost", service "5432" to
> address: Name or service not known WARNING:=A0 could not create listen
> socket for "localhost"
> FATAL:=A0 could not create any TCP/IP sockets
> ............................................................ .........
>... Similarly when I try to start postgres server with
> [postgres@callisto postgresql-8.3.7]$ pg_ctl -D pg8 start
> postgres cannot access the server configuration file
> "/usr/local/pgsql/postgresql-8.3.7/pg8/postgresql.conf": No such file
> or directory

This smells a lot like SElinux. Do you use SElinux? Try disabling it.

mfg zmi
=2D-=20
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4


--nextPart2642362.779PJ5a6bj
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEABECAAYFAkoEA1gACgkQzhSR9xwSCbROaQCfd7zV4qAnbXlrfT3QZ92i 5921
ovcAoJnA6v36EgQrlfpzEdgbuNa+4wiG
=XkwG
-----END PGP SIGNATURE-----

--nextPart2642362.779PJ5a6bj--

Re: How to check whether PostgreSQL server is up and running?

am 08.05.2009 16:33:25 von Tom Lane

Michael Monnerie writes:
> On Freitag 08 Mai 2009 Jan Muhammad wrote:
>> postmaster -D /usr/local/pgsql/data
>> LOG:  could not translate host name "localhost", service "5432" to
>> address: Name or service not known

> This smells a lot like SElinux.

No, it looks like his DNS setup is broken. Not being able to translate
"localhost" to "127.0.0.1" will break most networking services, not
only Postgres ...

regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: How to check whether PostgreSQL server is up and running?

am 08.05.2009 18:42:46 von dayat

This is a multi-part message in MIME format.

------=_NextPart_000_00AE_01C9D036.B0B6EF40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Ok let's to create a cluster for you, be sure the pg8 directory owned by
postgres user and the directory is empty.

[postgres@callisto]$ initdb -D /usr/local/pgsql/postgresql-8.3.7/pg8 -U
postgres -W

Type your password if they ask, wait initdb process until finish.

And try the server:
[postgres@callisto]$ pg_ctl -D /usr/local/pgsql/postgresql-8.3.7/pg8 start

enter to database postgres with user postgres and type your password
[postgres@callisto]$ psql postgres postgres -W

Tell me if this not work.

Regards
Hidayat

----- Original Message -----
From: Jan Muhammad
To: pgsql-admin@postgresql.org
Sent: Friday, May 08, 2009 4:11 PM
Subject: [ADMIN] How to check whether PostgreSQL server is up and running?


Hi,

After having various error message in starting PostgreSQL version
8.2.11; finally uninstalled/deleted it. Now trying my luck on 8.3.7, but
things haven't changed for me.
When I try to check that postmaster server is running or not? I get
the following error:
$ postmaster -D /usr/local/pgsql/data
LOG: could not translate host name "localhost", service "5432" to
address: Name or service not known
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
............................................................ ...........
Similarly when I try to start postgres server with
[postgres@callisto postgresql-8.3.7]$ pg_ctl -D pg8 start
postgres cannot access the server configuration file
"/usr/local/pgsql/postgresql-8.3.7/pg8/postgresql.conf": No such file or
directory
server starting

Have no idea what's wrong and where the problem is? Do I need to
change/edit some of Environment variable settings or what? Or should I
reinstall PostgreSQL with Yum?? Or should give up using PostgreSQL and
switch to some other DB like MySQL etc... No idea what to do.....?

Thanks in advance for help.

-Jan Muhammad




------=_NextPart_000_00AE_01C9D036.B0B6EF40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



http-equiv=3DContent-Type>





Ok let's to create a cluster for you, =
be sure the=20
pg8 directory owned by postgres user and the directory is =
empty.

 

face=3D"Times New Roman">[postgres@callisto]$ initdb -D size=3D3=20
face=3D"Times New Roman">/usr/local/pgsql/postgresql-8.3.7/pg8 -U =
postgres=20
-W

 

Type your password if they ask, wait =
initdb process=20
until finish.

 

And try the server:

face=3D"Times New Roman">[postgres@callisto]$ pg_ctl -D / size=3D3=20
face=3D"Times New Roman">usr/local/pgsql/postgresql-8.3.7/pg8=20
start

 

enter to database postgres with user postgres and type your =
password

[postgres@callisto]$ psql =
postgres postgres=20
-W

 

Tell me if this not work.

face=3DArial> 

Regards

Hidayat

 

----- Original Message -----=20
From: title=3Djanmuhd@yahoo.com href=3D"mailto:janmuhd@yahoo.com">Jan =
Muhammad

To: href=3D"mailto:pgsql-admin@postgresql.org">pgsql-admin@postg resql.org=

Sent: Friday, May 08, 2009 4:11 PM

Subject: [ADMIN] How to check whether PostgreSQL server is =
up and=20
running?






Hi,

After having various error message in =
starting=20
PostgreSQL version 8.2.11; finally uninstalled/deleted it. Now =
trying my=20
luck on  8.3.7, but things haven't changed for me.
When I =
try to=20
check that postmaster server is running or not? I get the =
following=20
error:
$ postmaster -D=20
/usr/local/pgsql/data

LOG:  could not translate =
host name=20
"localhost", service "5432" to address: Name or service not=20
known
WARNING:  could not create listen socket for=20
"localhost"
FATAL:  could not create any TCP/IP=20
=
sockets
............................................................ ..=
..........
Similarly=20
when I try to start postgres server with
[postgres@callisto=20
postgresql-8.3.7]$ pg_ctl -D pg8 =

start

postgres cannot access the server configuration =
file=20
"/usr/local/pgsql/postgresql-8.3.7/pg8/postgresql.conf": No such =
file or=20
directory
server starting

Have no idea what's wrong and =
where=20
the problem is? Do I need to change/edit some of Environment =
variable=20
settings or what? Or should I reinstall PostgreSQL with Yum?? Or =
should=20
give up using PostgreSQL and switch to some other DB like MySQL =
etc... No=20
idea what to do.....?

Thanks in advance for =
help.

-Jan=20
Muhammad




------=_NextPart_000_00AE_01C9D036.B0B6EF40--

__________________________________________________
Apakah Anda Yahoo!?
Lelah menerima spam? Surat Yahoo! memiliki perlindungan terbaik terhadap spam
http://id.mail.yahoo.com

Re: How to check whether PostgreSQL server is up and running?

am 08.05.2009 19:28:31 von Jan Muhammad

--0-1753739457-1241803711=:12589
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

Got it working now, though after several searches and hit-n-trials....

The problem was in my "/pgsql/data/pg_hba.conf"; where it needed my machine=
's IP.
Now got it working.=20

But the real issue of service is not yet being recognized=A0 with in the co=
mmand:
# service postgresql status
postgresql: unrecognized service
Or even:
#service pg_ctl status
pg_ctl: unrecognized service

And strange is=A0 when I do:=20
# /sbin/service --status-all
I can see among other service (pg_ctl) running:
pg_ctl: server is running (PID: 29330)
/usr/local/pgsql/bin/postgres "-i" "-D" "/usr/local/pgsql/data"


Don't know what is/was issue; but anyways Thanks for helping.

Regards

-Jan Muhammad
=0A--- On Fri, 5/8/09, dayat wrote:

From: dayat
Subject: Re: [ADMIN] How to check whether PostgreSQL server is up and runni=
ng?
To: pgsql-admin@postgresql.org
Date: Friday, May 8, 2009, 9:42 PM

=0A =0AOk let's to create a cluster for you, be sure the =0Apg=
8 directory owned by postgres user and the directory is empty.  =0A[pos=
tgres@callisto]$ initdb -D /usr/local/pgsql/postgresql-8.3.7/pg8 -U postgre=
s =0A-W  =0AType your password if they ask, wait initdb process =0Aunti=
l finish.  =0AAnd try the server:=0A[postgres@callisto]$ pg_ctl -D /usr=
/local/pgsql/postgresql-8.3.7/pg8 =0Astart  =0Aenter to database postgr=
es with user postgres and type your password=0A[postgres@callisto]$ psql po=
stgres postgres =0A-W  =0ATell me if this not work.  =0ARegards=0AH=
idayat  =0A----- Original Message ----- =0AFrom: Jan Muhammad =0ATo: pg=
sql-admin@postgresql.org =0ASent: Friday, May 08, 2009 4:11 PM=0ASubject: [=
ADMIN] How to check whether PostgreSQL server is up and =0Arunning?=0A
=0A =0A Hi,

After having various error message in starting =0A PostgreSQL version =
8.2.11; finally uninstalled/deleted it. Now trying my =0A luck on=A0 8=
..3.7, but things haven't changed for me.
When I try to =0A check that postmaster server is running or not? I ge=
t the following =0A error:
$ postmaster -D =0A /usr/local/pgsql/data
LOG:=A0 could not translate host name =0A "localhost", service "5432" =
to address: Name or service not =0A known
WARNING:=A0 could not create listen socket for =0A "localhost"
FATAL:=A0 could not create any TCP/IP =0A sockets
............................................................ ............
Similarly =0A when I try to start postgres server with=20
[postgres@callisto =0A postgresql-8.3.7]$ pg_ctl -D pg8 =0A start
postgres cannot access the server configuration file =0A "/usr/local/p=
gsql/postgresql-8.3.7/pg8/postgresql.conf": No such file or =0A direct=
ory
server starting

Have no idea what's wrong and where =0A the problem is? Do I need to c=
hange/edit some of Environment variable =0A settings or what? Or shoul=
d I reinstall PostgreSQL with Yum?? Or should =0A give up using Postgr=
eSQL and switch to some other DB like MySQL etc... No =0A idea what to=
do.....?

Thanks in advance for help.

-Jan =0A Muhammad


=0A
--0-1753739457-1241803711=:12589
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Hi,

Got it working now, though after s=
everal searches and hit-n-trials....

The problem was in my le=3D"font-weight: bold;">"/pgsql/data/pg_hba.conf"; where it needed=
my machine's IP.
Now got it working.

But the real issue of serv=
ice is not yet being recognized  with in the command:
=3D"font-weight: bold;"># service postgresql status
postgresql: u=
nrecognized service
Or even:
#serv=
ice pg_ctl status

pg_ctl: unrecognized service

And strange=
is  when I do:
# /sbin/service=
--status-all
I can see among other service (pg_ctl) running: n style=3D"font-weight: bold;">
pg_ctl: server is running (PID: 29330) r>/usr/local/pgsql/bin/postgres "-i" "-D" "/usr/local/pgsql/data"

span>
Don't
know what is/was issue; but anyways Thanks for helping.

Regards
=

-Jan Muhammad
=0A--- On Fri, 5/8/09, dayat <sql.muda@yahoo.=
co.id>
wrote:
(16, 16, 255); margin-left: 5px; padding-left: 5px;">
From: dayat <sq=
l.muda@yahoo.co.id>
Subject: Re: [ADMIN] How to check whether Postgre=
SQL server is up and running?
To: pgsql-admin@postgresql.org
Date: Fr=
iday, May 8, 2009, 9:42 PM

=0A =0A<=
style>=0A
=0A
"Arial" size=3D"2">Ok let's to create a cluster for you, be sure the =0Apg8=
directory owned by postgres user and the directory is empty.
=
=0A
 
=0A
ce=3D"Arial" size=3D"2">[postgres=
@callisto]
$ initdb -D /usr=
/local/pgsql/postgresql-8.3.7/pg8 -U postgres =0A-W
=0A<=
div> 
=0A
=3D"Arial" size=3D"2">Type your password if they ask, wait initdb process =
=0Auntil finish.
=0A
=0A
And try the server: ont>
=0A
oman" size=3D"3">[postgres@callisto]$ pg_ctl -D / New Roman" size=3D"3">usr/local/pgsql/postgresql-8.3.7/pg8 =0Astart=
=0A
 
=0A
enter to database postgres with us=
er postgres and type your password
=0A
[postgres@callisto] ce=3D"Arial" size=3D"2">$ psql postgres postgres =0A-W
=0A
=
 
=0A
ial" size=3D"2">Tell me if this not work.
=0A
"Arial" size=3D"2">  v>=0A
Regards
=0A
face=3D"Arial" size=3D"2">Hidayat
=0A
 
<=
/div>=0A
normal; font-weight: normal; font-size: 10pt; line-height: normal; font-si=
ze-adjust: none; font-stretch: normal;">----- Original Message ----- =0A v style=3D"background: rgb(228, 228, 228) none repeat scroll 0%; -moz-backg=
round-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-backgr=
ound-inline-policy: -moz-initial;">From: =3D"janmuhd@yahoo.com" ymailto=3D"mailto:janmuhd@yahoo.com" target=3D"_blan=
k" href=3D"/mc/compose?to=3Djanmuhd@yahoo.com">Jan Muhammad
=0A iv>To: lto=3D"mailto:pgsql-admin@postgresql.org" target=3D"_blank" href=3D"/mc/com=
pose?to=3Dpgsql-admin@postgresql.org">pgsql-admin@postgresql .org
=
=0A
Sent: Friday, May 08, 2009 4:11 PM
=0A
Subject:<=
/b> [ADMIN] How to check whether PostgreSQL server is up and =0Arunning? iv>
=0A

=0A cing=3D"0">=0A =0A =0A ble>
Hi,

After =
having various error message in starting =0A PostgreSQL version 8.2.11=
; finally uninstalled/deleted it. Now trying my =0A luck on  8.3.=
7, but things haven't changed for me.
When I try to =0A check that =
postmaster server is running or not? I get the following =0A error: >$ postmaster -D =0A /usr/local/pgs=
ql/data

LOG:  could not translate host name =0A "localh=
ost", service "5432" to address: Name or service not =0A known
WARN=
ING:  could not create listen socket for =0A "localhost"
FATAL=
:  could not create any TCP/IP =0A sockets
...................=
.....................................................
Similarly =0A =
when I try to start postgres server with
[postgres@callisto =0A po=
stgresql-8.3.7]$ pg_ctl -D pg8 =0A =
start

postgres cannot access the server configuration file =0A =
"/usr/local/pgsql/postgresql-8.3.7/pg8/postgresql.conf": No such file or=
=0A directory
server starting

Have no idea what's wrong and=
where =0A the problem is? Do I need to change/edit some of Environmen=
t variable =0A settings or what? Or should I reinstall PostgreSQL with=
Yum?? Or should =0A give up using PostgreSQL and switch to some other=
DB like MySQL etc... No =0A idea what to do.....?

Thanks in ad=
vance for help.

-Jan =0A Muhammad



--0-1753739457-1241803711=:12589--

Re: How to check whether PostgreSQL server is up and running?

am 11.05.2009 07:24:31 von Scott Marlowe

On Fri, May 8, 2009 at 11:28 AM, Jan Muhammad wrote:
> Hi,
>
> Got it working now, though after several searches and hit-n-trials....
>
> The problem was in my "/pgsql/data/pg_hba.conf"; where it needed my
> machine's IP.
> Now got it working.
>
> But the real issue of service is not yet being recognized=A0 with in the
> command:
> # service postgresql status
> postgresql: unrecognized service

Did you install postgresql as an RPM package? The service command in
redhat is designed to work with /etc/init.d/ scripts that are
installed by proper rpm packages. The service script that comes with
a source install is NOT designed to work properly with that specific
package. If you want service to work properly, I'd recommend sticking
to the PGDG redhat packages, it makes life much easier, especially for
beginners.

Snip

> Have no idea what's wrong and where the problem is? Do I need to change/e=
dit
> some of Environment variable settings or what? Or should I reinstall
> PostgreSQL with Yum?? Or should give up using PostgreSQL and switch to so=
me
> other DB like MySQL etc... No idea what to do.....?

Yes install with yum or rpm. If you want to have real fun, try
installing mysql from source.

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin