Postgresql server Auto start in HP-unix

Using edbstart and edbstop

The edbstart and edbstop utilities use the edbtab file to determine which instances
of Postgres Plus should start when the operating system boots, and stop when the
host is shut down.

  The edbstart utility starts a database cluster; if you do not provide a command-line
  argument, edbstart starts each cluster listed in the /etc/edbtab file.

  The edbstop utility stops a database cluster; if you do not provide a command-line
  argument, edbstart stops each cluster listed in the /etc/edbtab file.

The edb_autostart script invokes edbstart to automatically start each cluster listed in
/etc/edbtab when your host computer boots.


Configuring Automatic Startup/Shutdown

Perform the following steps to configure a Postgres Plus host to autostart or autostop:

*HPUX 11.31 Users: Please replace all the references to /etc with /sbin  with
the exception of step 1, and replace the value of EDBUSER variable in edb_autostart
from enterprisedb to edb.

1) Create a file named edbtab in the /etc directory; you can create a new file, or
   use the included file as a template.  Entries within the file should be of the form:

    <edbhome>:<datadir>:Y/N

  Add a separate entry for each Postgres Plus cluster.

2) Copy the edb_autostart script to /etc/init.d.

3) Copy edbstart and edbstop to <edbhome>

4) Adjust the permissions of the scripts to make them executable:

   chmod +x edbstart
    chmod +x edbstop
    chmod +x /etc/init.d/edb_autostart

5) Use the following commands to arrange for Postgres Plus to start
   automatically when the host boots.

  Linux Users:

    chkconfig --level 2345 edb_autostart on
    chkconfig --add edb_autostart

  Solaris Users: Please perform the following steps for each level (the following example
                 demonstrates level 2):

    ln -s /etc/init.d/edb_autostart /etc/rc2.d/S99edb_autostart
    ln -s /etc/init.d/edb_autostart /etc/rc2.d/K03edb_autostart

  HPUX 11.31 Users: Please perform the following steps for each level except 0 and 1
                 (the following example demonstrates level 2):
   ln -s /sbin/init.d/edb_autostart /sbin/rc2.d/S99edb_autostart
    ln -s /sbin/init.d/edb_autostart /sbin/rc2.d/K03edb_autostart


6) Reboot the Postgres Plus host.


Manually Invoking the Scripts

You can manually invoke the edb_autostart script by passing start or stop as an argument;
you can also manually invoke the individual edbstart or edbstop scripts.  To invoke the
scripts, you must log in as the cluster owner.

Optionally, specify a data directory as an argument when invoking edbstart or edbstop as
shown in the following example:

      edbstart /opt/PostgresPlus/<version>/data

Where <version> is the version of Advanced Server (e.g., 9.5AS).


If you provide a data directory, edbstart or edbstop will start or stop the cluster
that corresponds to that directory.

If you do not provide an argument when invoking the edbstart or edbstop script, the utility
will start or stop all clusters specified in the edbtab file.

NOTE: The script edb_autostart assumes that the database superuser is named "enterprisedb"
and the default installation path is "/opt/PostgresPlus/9.5AS". If you have a different
database superuser or a non-default installation path, modify the "EDBUSER" and "prefix"
variables in the edb_autostart script accordingly.


Comments

Popular Posts