Hitachi

For Linux(R) (x86) Systems HA Monitor Cluster Software


6.13.1 Creating a server start command

A server start command is used to start a program. If the server runs in the monitor mode, you must create a server start command so that HA Monitor can verify completion of server startup.

This subsection explains the timing of calling a server start command and how to create a server start command. For details about the operating environment of commands that are executed from HA Monitor, see 6.22 Operating environment of commands that are executed from HA Monitor.

Organization of this subsection

(1) Timing of calling a server start command

A created server start command is executed by HA Monitor with the superuser permissions.

The server start command is called after shared resources are connected in the following cases:

(2) How to create a server start command

For a server start command, you can specify a program or a shell that codes program startup processing.

Specify an operating environment needed to start the program within the shell. In RHEL7 or a later version, you can specify environment variables in the Unit settings file. However, the Unit settings file is overwritten when an overwrite installation of HA Monitor is performed. Therefore, we recommend that you specify an operating environment (environment variables) within the shell.

The following shows the environment variables that are inherited when the server startup command is executed.

When the monitor-mode server start command (monbegin command) is executed

The environment variables of the user who executed the monbegin command are inherited.

When the server is restarted#

The environment variables specified in the Unit settings file of HA Monitor are inherited in the following cases:

  • The OS is RHEL7 or a later version and the HA Monitor version is 01-65 or later.

  • The OS is RHEL7 or a later version, the HA Monitor version is earlier than 01-65, and HA Monitor automatically started when the system started.

The environment variables of the user who executed the HA Monitor start command (monstart command) are inherited in the following cases:

  • The OS is RHEL7 or a later version, the HA Monitor version is earlier than 01-65, and HA Monitor was started by using the monstart command.

  • The OS is RHEL6 and HA Monitor was started by using the monstart command.

The environment variables specified in the startup script /etc/rc.d/init.d/HAmon are inherited in the following cases:

  • The OS is RHEL6 and HA Monitor automatically started when the system started.

#

If the server started automatically by the function of the monbegin_restart operand in the HA Monitor environment settings, or if the server restarted by the function of the servexec_retry operand in the server environment definition.

To use a server start command to start a UAP that issues APIs when using the monitor-mode program management function, specify the program name in a UAP environment variable. In the server start command, specify all target UAP start processes. For details about the UAP environment variables, see 6.16.2 Specifying UAP environment variables. To acquire core files for investigation in the event of a UAP failure, add ulimit -c unlimited before the process for starting the UAP. The kernel parameter's default setting does not collect core files.

Specify the created server start command in the name operand in the server environment definition. To specify arguments in the server start command, also specify the arguments in the actcommand operand in the server environment definition.

Specify the following settings for the waitserv_exec operand in the server environment definition according to the type of the server start command.

Table 6‒9: Value to be specified for the waitserv_exec operand according to the type of the server start command

Type of the server start command

Setting when servers are monitored

Setting when servers are not monitored

A server start command that does not return the result when the start processing of the target programs is completed.

For example, a server start command in which programs are directly specified.

no

no

A server start command that returns the result when the start processing of the target programs is completed.

yes

Either value

For a program that directly operates as a server process

Specify no in the waitserv_exec operand in the server environment definition. This is the default. For a program that directly functions as a server process, make sure that you specify no because it does not wait for completion of startup processing.

For a program that does not directly operate as a server process

If you monitor servers in the monitor mode, make sure that you specify yes in the waitserv_exec operand in the server environment definition.

If you do not specify yes when servers in the monitor mode are to be monitored, an active server's startup processing might be completed on HA Monitor and monitoring of servers might begin before the program completes its startup processing. If monitoring of servers begins before the program's startup processing is completed, the incomplete program start status might be treated as a server failure, resulting in a restart of the active server and hot standby processing.

If servers in the monitor mode are not to be monitored, you can specify either yes or no. However, you must specify yes in the following cases:

  • The server switchover order is to be controlled between servers in the monitor mode.

  • The processing to be performed will be determined on the basis of the EXIT code from the server start command.

If yes is specified in the waitserv_exec operand in the server environment definition, HA Monitor evaluates the return value of the server start command that is specified in the name or actcommand operand in the server environment definition. The following describes the HA Monitor processing that depends on the return value:

If you specify yes in the waitserv_exec operand in the server environment definition, you can specify a timeout value from start to termination of the server start command in the start_timeout operand in the server environment definition.

Note that hot-standby switchover is not performed in the following cases:

If you want hot-standby switchover to be performed in the preceding cases, create a start command that always returns a return value of 0. In addition, make sure that the monitoring command can detect a server start failure.

If you specify no in the waitserv_exec operand in the server environment definition, HA Monitor performs start completion processing on the active server regardless of the server start command's return value.