Starting PostgreSQL


PostgreSQL is generally started from the command line using the pg_ctl utility, but usually only the postgres user can execute this utility. If you followed standard PostgreSQL installation instructions, then this will apply. Upon becoming the postgres user, the following command can be executed from the command line to start the PostgreSQL server:

 [postgres]$ pg_ctl -o"-i" -D /usr/local/pgsql/data \ -l /usr/local/pgsql/pg.log start postmaster starting

This command tells the pg_ctl utility to start the PostgreSQL server by passing the -i option to allow TCP/IP (remote) connections (the -o argument passes anything in quotation marks directly to the PostgreSQL server), using the /usr/local/pgsql/data directory to hold all data files and tell the log statements to go into the /usr/local/pgsql/pg.log file.

Notice the message in the previous output when executing pg_ctl that indicates that PostgreSQL is being started. The postmaster fronts the PostgreSQL server, and this message is simply pg_ctl telling you that the server is going to start up. To be sure that it actually did start, take a peak in the log file that was specified earlier and it will show some additional information similar to the following:

 LOG:  database system was shut down at 2005-11-06 13:00:20 MST LOG:  checkpoint record is at 0/A5F09C LOG:  redo record is at 0/A5F09C; undo record is at 0/0; shutdown TRUE LOG:  next transaction ID: 560; next OID: 17232 LOG:  database system is ready

The important part of the log file above is the last statement, indicating that the database is ready. Now that a PostgreSQL instance is running, the next topic of concern is how JDBC resources help Geronimo communicate with this PostgreSQL instance.




Professional Apache Geronimo
Professional Apache Geronimo (Wrox Professional Guides)
ISBN: 0471785431
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net