Hitachi

JP1 Version 12 JP1/Base User's Guide


5.9.3 Logical host operation in a non-cluster environment

JP1 operations and backup and recovery procedures are the same on a logical host that does not fail over as on a logical host in a cluster system. However, this excludes the fact that the logical host does not fail over with the cluster software.

Organization of this subsection

(1) Startup and termination

Start JP1 services on the logical host in the following order:

  1. JP1/Base

  2. JP1 programs for which JP1/Base is a prerequisite

Stop JP1 services on the logical host in the following order:

  1. JP1 programs for which JP1/Base is a prerequisite

  2. JP1/Base

(2) Examples of setting up automatic startup and automatic termination

To start and stop JP1 services on a logical host automatically at system startup and shutdown, you must set up JP1/Base as described below. The procedure differs for each OS. The following shows the procedure for each OS.

(a) In Windows

  1. Using a text editor, add the following lines to the start sequence definition file (JP1SVPRM.DAT):

    File location: installation-folder\conf\boot\JP1SVPRM.DAT

    [Jp1BaseEvent_logical-host-name]
    Name=JP1/BaseEvent_logical-host-name
    ServiceName=JP1_Base_Event logical-host-name
     
    [Jp1Base_logical-host-name]
    Name=JP1/Base_logical-host-name
    ServiceName=JP1_Base_logical-host-name
    StopCommand=jbs_spmd_stop.exe -h logical-host-name
     
    [Jp1AJS2_logical-host-name]
    Name=JP1/AJS2_logical-host-name
    ServiceName=JP1_AJS2_logical-host-name
    StopCommand=jajs_spmd_stop.exe -h logical-host-name

    The command specified in StopCommand is executed when JP1/Power Monitor shuts down the host.

(b) HP-UX environment

  1. Create the automatic startup and automatic termination scripts for the logical host.

    Location:/sbin/init.d/jp1_service_cluster

    Example automatic startup and automatic termination scripts

    #!/bin/sh
     
    ## Set Environment-variables
    PATH=/sbin:/bin:/usr/bin:/opt/jp1base/bin
    export PATH
    JP1_HOSTNAME=logical-host-name
    export JP1_HOSTNAME
     
    case $1 in
    start_msg)
          echo "Start JP1 Service $JP1_HOSTNAME"
          ;;
     
    stop_msg)
          echo "Stop JP1 Service $JP1_HOSTNAME"
          ;;
     
    'start')
          if [ -x /etc/opt/jp1base/jbs_start.cluster ]
          then
                  /etc/opt/jp1base/jbs_start.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1ajs2/jajs_start.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_start.cluster $JP1_HOSTNAME
          fi
          ;;
     
    'stop')
          if [ -x /etc/opt/jp1ajs2/jajs_stop.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_stop.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1base/jbs_stop.cluster ]
          then
                  /etc/opt/jp1base/jbs_stop.cluster $JP1_HOSTNAME
          fi
          ;;
     
    esac
     
    exit 0
  2. Link to the scripts you created at step 1.

    Startup script

    Execute the following command to set up the link:

    ln -s /sbin/init.d/jp1_service_cluster /sbin/rc2.d/S***_JP1_SERVICE

    The higher the value in ***, the later the startup script is executed.

    Termination script

    Execute the following command to set up the link:

    ln -s /sbin/init.d/jp1_service_cluster /sbin/rc1.d/K***_JP1_SERVICE

    The higher the value in ***, the later the termination script is executed.

    Typically, set the values so that a JP1 service that starts earlier stops later.

(c) Solaris environment

  1. Create the automatic startup and automatic termination scripts for the logical host.

    Location: /etc/init.d/jp1_service_cluster

    Example automatic startup and automatic termination scripts

    #!/bin/sh
     
    ## Set Environment-variables
    PATH=/sbin:/bin:/usr/bin:/opt/jp1base/bin
    export PATH
    JP1_HOSTNAME=logical-host-name
    export JP1_HOSTNAME
     
    case $1 in
    start_msg)
          echo "Start JP1 Service $JP1_HOSTNAME"
          ;;
     
    stop_msg)
          echo "Stop JP1 Service $JP1_HOSTNAME"
          ;;
     
    'start')
          if [ -x /etc/opt/jp1base/jbs_start.cluster ]
          then
                  /etc/opt/jp1base/jbs_start.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1ajs2/jajs_start.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_start.cluster $JP1_HOSTNAME
          fi
          ;;
     
    'stop')
          if [ -x /etc/opt/jp1ajs2/jajs_stop.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_stop.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1base/jbs_stop.cluster ]
          then
                  /etc/opt/jp1base/jbs_stop.cluster $JP1_HOSTNAME
          fi
          ;;
     
    esac
     
    exit 0
  2. Link to the scripts you created at step 1.

    Startup script

    Execute the following command to set up the link:

    ln -s /etc/init.d/jp1_service_cluster /etc/rc2.d/S**_JP1_SERVICE

    The higher the value in **, the later the startup script is executed.

    Termination script

    Execute the following command to set up the link:

    ln -s /etc/init.d/jp1_service_cluster /etc/rc0.d/K**_JP1_SERVICE

    The higher the value in **, the later the termination script is executed.

    Typically, set the values so that a JP1 service that starts earlier stops later.

(d) In AIX environment

  1. Using the mkitab command, make the following entries in the /etc/inittab file:

    # mkitab -i hntr2mon "unique-ID:2:wait:/etc/opt/jp1base/jbs_start.cluster logical-host-name"
    # mkitab -i unique-ID "unique-ID:2:wait:/etc/opt/jp1ajs2/jajs_start.cluster logical-host-name"

    Note: Be sure to define unique-ID by using no more than 14 bytes, and use an ID that is unique within the file.

    Example:

    # mkitab -i hntr2mon "jp1base_ronri1:2:wait:/etc/opt/jp1base/jbs_start.cluster logical-host-name"
    # mkitab -i jp1base_ronri1 "jp1ajs2_ronri1:2:wait:/etc/opt/jp1ajs2/jajs_start.cluster logical-host-name"

    The added lines execute startup processing for JP1 services when the system starts.

  2. Using a text editor, add the following lines to the /etc/rc.shutdown file, after the code that terminates programs for which JP1/Base is a prerequisite:

    test -x /etc/opt/jp1ajs2/jajs_stop.cluster && /etc/opt/jp1ajs2/jajs_stop.cluster logical-host-name
    test -x /etc/opt/jp1base/jbs_stop.cluster && /etc/opt/jp1base/jbs_stop.cluster logical-host-name
    test -x /opt/hitachi/HNTRLib2/etc/D002stop &&  
    /opt/hitachi/HNTRLib2/etc/D002stop 

    The added lines execute termination processing for JP1 services when the system stops.

(e) Linux (except Linux 7) environment

For the procedure for a Linux 7 environment, see (f) Linux 7 environment.

  1. Create the automatic startup and automatic termination scripts for the logical host.

    Location: /etc/rc.d/init.d/jp1_service_cluster

    Example automatic startup and automatic termination scripts

    #!/bin/sh
     
    ## Set Environment-variables
    PATH=/sbin:/bin:/usr/bin:/opt/jp1base/bin
    export PATH
    JP1_HOSTNAME=logical-host-name
    export JP1_HOSTNAME
     
    case $1 in
    start_msg)
          echo "Start JP1 Service $JP1_HOSTNAME"
          ;;
     
    stop_msg)
          echo "Stop JP1 Service $JP1_HOSTNAME"
          ;;
     
    'start')
          if [ -x /etc/opt/jp1base/jbs_start.cluster ]
          then
                  /etc/opt/jp1base/jbs_start.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1ajs2/jajs_start.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_start.cluster $JP1_HOSTNAME
          fi
          touch /var/lock/subsys/_JP1_SERVICE
          ;;
     
    'stop')
          if [ -x /etc/opt/jp1ajs2/jajs_stop.cluster ]
          then
                  /etc/opt/jp1ajs2/jajs_stop.cluster $JP1_HOSTNAME
          fi
          if [ -x /etc/opt/jp1base/jbs_stop.cluster ]
          then
                  /etc/opt/jp1base/jbs_stop.cluster $JP1_HOSTNAME
          fi
          rm -f /var/lock/subsys/_JP1_SERVICE
          ;;
    esac
     
    exit 0
  2. Link to the scripts you created in step 1.

    Startup script

    Execute the following command to set up the link:

    ln -s /etc/rc.d/init.d/jp1_service_cluster /etc/rc.d/rc3.d/S**_JP1_SERVICE

    ln -s /etc/rc.d/init.d/jp1_service_cluster /etc/rc.d/rc5.d/S**_JP1_SERVICE

    The higher the value in **, the later the startup script is executed.

    Termination script

    Execute the following command to set up the link:

    ln -s /etc/rc.d/init.d/jp1_service_cluster /etc/rc.d/rc0.d/K**_JP1_SERVICE

    ln -s /etc/rc.d/init.d/jp1_service_cluster /etc/rc.d/rc6.d/K**_JP1_SERVICE

    The higher the value in **, the later the startup script is executed.

    In most circumstances, you should set the values so that a JP1 service that starts earlier stops later.

When you configure a JP1 service to terminate automatically, you must also configure it to start automatically. The system will not execute the termination script for a JP1 service that is configured to terminate but not start automatically.

(f) Linux 7 environment

  1. Create a Unit file (for automatic startup and termination) for the logical host.

    Location: /etc/systemd/system/jp1_base_logical-host-name.service

    Example of a Unit file

    [Unit]
    # Service name
    Description=JP1/Base logical-host-name Service
    After=rsyslog.service network.target network.service HNTRLib2D002.service
    ConditionFileIsExecutable=/etc/opt/jp1base/jbs_start.cluster
    ConditionFileIsExecutable=/etc/opt/jp1base/jbs_stop.cluster
     
    [Service]
    # Service type
    Type=forking
     
    # Service operations
    ExecStart=/etc/opt/jp1base/jbs_start.cluster logical-host-name
    ExecStop=/etc/opt/jp1base/jbs_stop.cluster logical-host-name
     
    KillMode=none
     
    StandardOutput=null
    StandardError=null
     
    [Install]
    WantedBy=multi-user.target graphical.target
  2. Enable the Unit file.

    Execute the following command to enable the Unit file:

    systemctl --system enable jp1_base_logical-host-name.service

When you configure a JP1 service to terminate automatically, you must also configure it to start automatically. The system will not execute the termination script for a JP1 service that is configured to terminate but not start automatically.

(g) Setting to start and stop JP1 automatically on both logical host and physical host

To start and stop JP1 automatically on the logical host and physical host, you must perform the following setting in addition to the setup for automatic startup and termination of the logical host. Note that the setup procedure depends on the OS. The following shows the procedure for each OS.

In Windows:

The startup control executes start/stop processing in the order in which services are written in the start sequence definition file (JP1SVPRM.DAT), starting from the service written first. If you want to change the order in which the physical host and logical host start or stop, define their start/stop sequence in this file, in the order in which you want the hosts to start or stop.

In HP-UX, Solaris, and Linux:

The order in which JP1 services start and stop automatically is determined by the value set in the numerical portion (S** and K**) in the automatic startup and automatic termination scripts. The higher the value, the later the service starts or stops. For a physical host, the symbolic links to these scripts are created at installation. If you want the logical host to start and stop automatically with the physical host, adjust the start/stop sequence by changing the names of the symbolic links created for the logical host.

JP1/Base describes automatic startup and automatic termination scripts for a physical host in advance. The table below describes the symbolic links to these scripts.

Table 5‒5: Symbolic links to automatic startup and automatic termination scripts for a physical host

OS

Startup script

Termination script

HP-UX

/sbin/rc2.d/S900jp1_base

/sbin/rc1.d/K100jp1_base

Solaris

/etc/rc2.d/S99_JP1_10_BASE

/etc/rc0.d/K01_JP1_90_BASE

Linux (except Linux 7)

/etc/rc.d/rc3.d/S99_JP1_10_BASE

/etc/rc.d/rc5.d/S99_JP1_10_BASE

/etc/rc.d/rc0.d/K01_JP1_90_BASE

/etc/rc.d/rc6.d/K01_JP1_90_BASE

Adjust the order in which the physical host and logical host start and stop by changing the S** and K** (number) part of the symbolic links shown above so that its value is higher or lower relative to the S** and K** (number) part of the symbolic links in the automatic startup and termination scripts.

For example, if you want to start the logical host first, set the number part (S**) of the symbolic link to the automatic startup script you created for the logical host to a value lower than 900 (for HP-UX) or 99 (for Solaris and Linux).

For details about the settings to adjust the order in which JP1 services start and stop automatically between the logical host and physical host in Linux 7, see (h) below.

In AIX:

To start and stop the physical host automatically, additional settings are required. For details on the additional settings, see 7.2.1 Setting services to start and stop automatically.

(h) Settings to adjust the start order between a physical host and logical host (in a Linux 7 environment)

You can adjust the order in which JP1 services start and stop automatically between a physical host and logical host in a Linux 7 environment. To do this, you must specify the following settings in addition to the settings to start and stop JP1 services automatically on the logical host.

To start JP1 services on the physical host first:

Edit the Unit file for the logical host.

Location: /etc/systemd/system/jp1_base_logical-host-name.service

Part to edit: Add jp1_base.service to the end of the After= line.

Example of a Unit file

[Unit]
# Service name
Description=JP1/Base logical-host-name Service
After=rsyslog.service network.target network.service HNTRLib2D002.service jp1_base.service
ConditionFileIsExecutable=/etc/opt/jp1base/jbs_start.cluster
ConditionFileIsExecutable=/etc/opt/jp1base/jbs_stop.cluster
To start P1 services on the logical host first:

Edit the Unit file for the logical host.

Location: /etc/systemd/system/jp1_base_logical-host-name.service

Part to edit: Add the Before= line, and then define jp1_base.service.

Example of a Unit file

[Unit]
# Service name
Description=JP1/Base logical-host-name Service
Before=jp1_base.service
After=rsyslog.service network.target network.service HNTRLib2D002.service
ConditionFileIsExecutable=/etc/opt/jp1base/jbs_start.cluster
ConditionFileIsExecutable=/etc/opt/jp1base/jbs_stop.cluster

(3) Operations on JP1 running on the logical host

When executing a command for JP1 configured on a logical host, specify the logical host name explicitly in the same way as for a logical host running in a cluster system.

(4) Inheritance of logical host information

A logical host in a non-cluster environment cannot be failed over because it does not inherit the management information on the shared disk. For this reason, do not use such a logical host in a multiple-host environment where a logical host IP is passed from one host to another.