pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
starting postgres on red hat
8+ messages / 4 participants
[nested] [flat]

* starting postgres on red hat
@ 2008-09-11 16:57  Marc Fromm <Marc.Fromm@wwu.edu>
  0 siblings, 2 replies; 8+ messages in thread

From: Marc Fromm @ 2008-09-11 16:57 UTC (permalink / raw)
  To: pgsql-admin


I installed Red Hat 5.2 EL. During the install I select postgresql and this versoin was installed: postgresql-8.1.11-1.el5_1.1.

1. I started postgresql as follows:
initdb -D /var/lib/pgsql/data

2. I started the database server as follows:
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

3. I started the postmaster as follows:
service postgresql start

When I check that it is all running with ps command I get:
324 pts/1    S      0:00 /usr/bin/postmaster -D /var/lib/pgsql/data

When I did the same setps in fedora 8  the postmaster was started on a port
1703 ?        S      0:01 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data

Why is there no -p 5432 on the red hat box? I assume the port is needed. What do I need to do to have the postmaster running on port 5432 like on the fedora box?

Thanks

Marc



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

* Re: starting postgres on red hat
@ 2008-09-11 17:21  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Marc Fromm <Marc.Fromm@wwu.edu>
  1 sibling, 3 replies; 8+ messages in thread

From: Scott Marlowe @ 2008-09-11 17:21 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin

On Thu, Sep 11, 2008 at 10:57 AM, Marc Fromm <Marc.Fromm@wwu.edu> wrote:
>
> I installed Red Hat 5.2 EL. During the install I select postgresql and this versoin was installed: postgresql-8.1.11-1.el5_1.1.
>
> 1. I started postgresql as follows:
> initdb -D /var/lib/pgsql/data

There's an initidb function built into the /etc/init.d/postgresql
script you can use:

sudo /etc/init.d/postgresql initdb

both work similarly.

> 2. I started the database server as follows:
> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
>
> 3. I started the postmaster as follows:
> service postgresql start

These two steps do the same thing.  the db server was already started
in step2.   The preferred way is how you did it in step 3.

> When I check that it is all running with ps command I get:
> 324 pts/1    S      0:00 /usr/bin/postmaster -D /var/lib/pgsql/data
>
> When I did the same setps in fedora 8  the postmaster was started on a port
> 1703 ?        S      0:01 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
>
> Why is there no -p 5432 on the red hat box? I assume the port is needed. What do I need to do to have the postmaster running on port 5432 like on the fedora box?

Because pgsql is reading it from the postgresql.conf file.

Stick to the /etc/init.d/postgresql way of starting and stopping.

To set pgsql to start automatically on bootup, use chkconfig:

chkconfig postgresql on
chkconfig --list postgresql



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

* Re: starting postgres on red hat
@ 2008-09-11 17:28  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  2 siblings, 2 replies; 8+ messages in thread

From: Scott Marlowe @ 2008-09-11 17:28 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin

Oh yeah, please note that the proper way to start and stop services on
RH oses is via the service command:

service postgresql start
service postgresql initdb

etc...



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

* Re: starting postgres on red hat
@ 2008-09-11 18:00  John <lists@johndubchak.com>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: John @ 2008-09-11 18:00 UTC (permalink / raw)
  To: pgsql-admin

Scott Marlowe wrote:
> Oh yeah, please note that the proper way to start and stop services on
> RH oses is via the service command:
>
> service postgresql start
> service postgresql initdb
>
> etc...
>   
Scott,

How does the above compare with using postmaster to start PostgreSQL?

I tried in the past to use the "service postgresql start" command, but 
couldn't connect from a java application.  I gave up and have been using 
a script that uses postmaster to append a "-i" to the command line to 
allow TCP/IP connections from a Java app.

Can that be configured in postgresql.conf?

Thanks,
John



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

* Re: starting postgres on red hat
@ 2008-09-11 18:14  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Scott Marlowe @ 2008-09-11 18:14 UTC (permalink / raw)
  To: John <lists@johndubchak.com>; +Cc: pgsql-admin

On Thu, Sep 11, 2008 at 11:36 AM, John <lists@johndubchak.com> wrote:
> Scott Marlowe wrote:
>>
>> Oh yeah, please note that the proper way to start and stop services on
>> RH oses is via the service command:
>>
>> service postgresql start
>> service postgresql initdb
>>
>> etc..
>
> Scott,
>
> How does the above compare with using postmaster to start Postgres?
>
> I tried in the past to use the "service postgresql start" command, but
> couldn't connect from a java application and have gotten in the habit of
> using a script that uses postmaster to append a "-i" to the command line to
> allow TCP/IP connections.

Yeah, you can't stop / stop services as anything but root on centos.
so unless you were running the receiving end to the java app as root,
it wouldn't be able to restart pgsql.

On ubuntu the postgres account can restart with
/etc/init.d/postgresql, nice feature.

> Can that be configured in postgresql.conf?

Yes, it's the line where you tell it what host adapters to use, or on
older pgsql's also the tcp_connection parameter (I think I spelt it
right, been a while)



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

* Re: starting postgres on red hat
@ 2008-09-11 18:17  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Scott Marlowe @ 2008-09-11 18:17 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin

On Thu, Sep 11, 2008 at 11:35 AM, Marc Fromm <Marc.Fromm@wwu.edu> wrote:
> Thanks for your reply.
> I was following the instructions a listed in the 8.1 docs at postgresql.org, which worked great on fedora.

I'm using the PGDG 8.3.3 rpms on Centos 5.2 mysql.  Those do have
initdb.  On older pgsql init scripts, it would automagically initdb
when needed, which was deemed (right so) to be a dangerous way of
doing things.  I'd highly suggest downloading and installing the pgsql
8.3.3 PGDG rpms, or pointing your server at a repo that has them.

> How do I restart the process?
> Running "/etc/init.d/postgresql initdb" as root diplays this:
> Usage: /etc/init.d/postgresql {start|stop|status|restart|condrestart|condstop|reload|force-reload}

yep. older init script / not PGDG one for 8.3.3.  that one likely does
the automagic initdb for you first time you run it.



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

* Re: starting postgres on red hat
@ 2008-09-11 18:23  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Devrim GÜNDÜZ @ 2008-09-11 18:23 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: Marc Fromm <Marc.Fromm@wwu.edu>; pgsql-admin

On Thu, 2008-09-11 at 11:21 -0600, Scott Marlowe wrote:
> There's an initidb function built into the /etc/init.d/postgresql
> script you can use:
> 
> sudo /etc/init.d/postgresql initdb

It won't work in pre 8.2 releases.

Regards,
-- 
Devrim GÜNDÜZ, RHCE
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org

Attachments:

  signature.asc (application/pgp-signature, 196B) download

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

* Re: starting postgres on red hat
@ 2008-09-11 18:28  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: Marc Fromm <Marc.Fromm@wwu.edu>
  1 sibling, 0 replies; 8+ messages in thread

From: Devrim GÜNDÜZ @ 2008-09-11 18:28 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin

On Thu, 2008-09-11 at 09:57 -0700, Marc Fromm wrote:
> When I check that it is all running with ps command I get:
> 324 pts/1    S      0:00 /usr/bin/postmaster -D /var/lib/pgsql/data
> 
> When I did the same setps in fedora 8  the postmaster was started on a
> port
> 1703 ?        S      0:01 /usr/bin/postmaster -p 5432
> -D /var/lib/pgsql/data
> 
> Why is there no -p 5432 on the red hat box? 

I may be wrong, but IIRC PostgreSQL started listening to localhost:5432
by default as of 8.2 . Fedora 8 ships with 8.2, that may be the reason
that you see -p 5432 there.

Regards,
-- 
Devrim GÜNDÜZ, RHCE
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org

Attachments:

  signature.asc (application/pgp-signature, 196B) download

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


end of thread, other threads:[~2008-09-11 18:28 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-09-11 16:57 starting postgres on red hat Marc Fromm <Marc.Fromm@wwu.edu>
2008-09-11 17:21 ` Scott Marlowe <scott.marlowe@gmail.com>
2008-09-11 17:28   ` Scott Marlowe <scott.marlowe@gmail.com>
2008-09-11 18:00     ` John <lists@johndubchak.com>
2008-09-11 18:14     ` Scott Marlowe <scott.marlowe@gmail.com>
2008-09-11 18:17   ` Scott Marlowe <scott.marlowe@gmail.com>
2008-09-11 18:23   ` Devrim GÜNDÜZ <devrim@gunduz.org>
2008-09-11 18:28 ` Devrim GÜNDÜZ <devrim@gunduz.org>

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