Hitachi

JP1 Version 12 JP1/Automatic Job Management System 3 Configuration Guide


17.2.10 Setting startup of multiple scheduler services on a logical host

To start multiple scheduler services, first set information such as the names of the scheduler services to be added and then create databases for those scheduler services.

The following describes the procedure for adding scheduler services on a logical host and the procedure for deleting scheduler services that have been added.

Organization of this subsection

(1) Adding scheduler services on a logical host

The following describes the procedure for adding scheduler services on a logical host.

(a) Tasks required on the primary node

To specify the necessary settings on the primary node:

  1. Stop the JP1/AJS3 service.

    Execute the following commands to confirm that all processes on the logical host have stopped:

    jajs_spmd_stop -h logical-host-name
    jajs_spmd_status -h logical-host-name
    Important

    All embedded databases configured on the target logical host must be operating. Execute the ajsembdbstatus command with -s ust -id _JFn (n: 1 to 9 or A to Z) specified to confirm that the embedded database is operating (UNIT-STAT is ONLINE). If the database is not operating, use the ajsembdbstart command with -id _JFn specified to activate it.

    Execute the ajsembdbidlist command to check the setup identifier (_JFn) of the embedded database to be activated.

  2. Use the mkdir command or another means to create the following directories on the shared disk:

    • Database directory

    • Directory for temporary files

    • Job information directory

    • Backup information directory

    Make sure that the above directories, other than the backup information directory, are neither directories used by other scheduler services set on the local hosts (the physical host and all logical hosts) nor subdirectories of those directories.

  3. Execute the jajs_setup command to add the scheduler service.

    jajs_setup -a -h logical-host
     -F scheduler-service
     -p service-for-the-port-reporting-the-job-status
     -d database-directory
     -t directory-for-temporary-files
     -j job-information-directory
     -b backup-information-directory
     -n scheduler-service-ID-number
     -D logical-host-shared-directory
     [-I setup-identifier
      -P embedded-database-port-number
      [-M {s|m|l}]
      [-B]
     |-S]

    Example of adding a scheduler service named AJSROOT3 to the logical host node0 whose shared directory is /shdsk/node0:

    jajs_setup -a -h node0
     -F AJSROOT3
     -p jp1ajs2report3
     -d "/shdsk/node0/jp1ajs2/database/schedule/AJSROOT3"
     -t "/shdsk/node0/jp1ajs2/tmp/schedule3"
     -j "/shdsk/node0/jp1ajs2/jobinf3"
     -b "/shdsk/node0/jp1ajs2/backup/schedule3"
     -n 3
     -D "/shdsk/node0"
     -I _JF3
     -P 22222

    For details about the jajs_setup command, see jajs_setup in 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

  4. Perform advanced setup for the embedded database.

    If you specified the -S option in step 3, perform advanced setup for the embedded database. For details about advanced setup for the embedded database, see 23.5 Advanced setup for the embedded database (in a cluster configuration).

  5. For the service name of the port that reports the job status specified in step 3, set the port number.

    Open the /etc/services file with a text editor, and add the port number. When you add a scheduler service to a logical host, make sure that the scheduler service does not use a port number that is used by another scheduler service that runs on the logical host. However, this note does not apply if you add a new logical host and add a scheduler service to the logical host. In this case, no problems occur if the scheduler services on different logical hosts use the same port number.

    Example of setting 20248 as the port number:

    jp1ajs2report3 20248/tcp
  6. If you want to use queueless jobs, you must perform the setup required for using queueless jobs.

    Execute the following command:

    ajsqlsetup -F scheduler-service -h logical-host

    For details about the ajsqlsetup command, see ajsqlsetup in 4. Commands Used for Special Operation in the manual JP1/Automatic Job Management System 3 Command Reference.

  7. Restart the JP1/AJS3 service to which you have added the scheduler service.

    The scheduler service is added and started with the specified settings.

(b) Tasks required on the secondary node

To specify the necessary settings on the secondary node:

  1. Set up the embedded database on the secondary node.

    Note: This step is required only if the setup identifier specified during setup on the primary node is an identifier that is not output by the ajsembdbidlist command.

    This step is required only if a new embedded database is created (the setup identifier of an existing embedded database is not specified for the -I option of the command) during setup on the primary node. You can check the setup identifier of the embedded database by using the ajsembdbidlist command.

    Execute the following commands:

    ajsembdbinstl
     -s directory-containing-the-embedded-database-installation-media
     -id setup-identifier
     -mh logical-host-name
     
    ajsembdbbuild
     -conf embedded-database-settings-file-name

    For setup-identifier, specify the value you specified on the primary node.

    For the embedded database settings file, copy the file that was output when the embedded database was created on the primary node to the secondary node.

    The following indicates the output destination of the embedded database settings file:

    embedded-database-practical-directory/conf/ajsdbst/ajsembdbsetup-identifier.conf

    For details about the commands executed in this step, see 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

    For example, if the setup identifier is _JF3 and the embedded database settings file is placed in /tmp/ajsembdb_JF3.conf, execute commands as follows to set up the embedded database on logical host node0:

    ajsembdbinstl
     -s /opt/jp1ajs2/tools/AJS3DB
     -id _JF3
     -mh node0
     
    ajsembdbbuild
     -conf /tmp/ajsembdb_JF3.conf
  2. Set the common definition information of the primary node on the secondary node.

    When you have completed the tasks for the primary node, execute the jbsgetcnf command on the primary node to save the common definition information. Copy the saved file to the secondary node, specify the name of the saved file as an argument, and execute the jbssetcnf command.

    Execute the commands as follows:

    On the primary node:

    jbsgetcnf -h logical-host > backup-file

    On the secondary node:

    jbssetcnf backup-file

  3. On the secondary host, set the port number that you set in step 5 in (a) above.

    Open the /etc/services file with a text editor, and add the port number. make sure that you add the same port number that you set on the primary node.

    Example of setting 20248 as the port number:

    jp1ajs2report3 20248/tcp
  4. If you want to use queueless jobs, you must perform the setup required for using queueless jobs.

    Execute the following command:

    ajsqlsetup -F scheduler-service -h logical-host -nc

    For details about the ajsqlsetup command, see ajsqlsetup in 4. Commands Used for Special Operation in the manual JP1/Automatic Job Management System 3 Command Reference.

Supplementary note on commands executed:

If multiple scheduler services are running and you execute the command without specifying the -F scheduler-service option, the system assumes the command is being executed for the default scheduler service.

You can omit the -F option if you specify a scheduler service name in the AJSCONF environment variable.

(2) Deleting an added scheduler service

When you delete a scheduler service that has been added, you must delete it from both the primary node and the secondary node.

To delete an added scheduler service:

  1. Execute the jajs_spmd_stop command to stop JP1/AJS3 services.

    Stop all JP1/AJS3 services, including JP1/AJS3 - Manager on the physical host.

    Important

    All embedded databases configured on the target logical host must be operating. Execute the ajsembdbstatus command with -s ust -id _JFn (n: 1 to 9 or A to Z) specified to confirm that the embedded database is operating (UNIT-STAT is ONLINE). If the database is not operating, use the ajsembdbstart command with -id _JFn specified to activate it.

    Execute the ajsembdbidlist command to check the setup identifier (_JFn) of the embedded database to be activated.

  2. Execute the ajsshmdel command to delete the information about the shared memory.

    The ajsshmdel command is located in /opt/jp1ajs2/bin/ajsshmdel.

    If the shell is sh, the command line is as follows:

    /opt/jp1ajs2/bin/ajsshmdel >/dev/null 2>&1

    If the shell is csh, the command line is as follows:

    /opt/jp1ajs2/bin/ajsshmdel >&/dev/null
  3. Execute the jajs_setup command to delete the scheduler service.

    jajs_setup -e -F scheduler-service

    Example of the command executed when the scheduler service to be deleted is AJSROOT3:

    jajs_setup -e -F AJSROOT3

    For details about the jajs_setup command, see jajs_setup in 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

    On the secondary node, use the jbsunsetcnf command instead of the jajs_setup command.

    jbsunsetcnf  -i -h logical-host-name -c JP1AJSMANAGER -n scheduler-service-name

    Example of the command for deleting the scheduler service AJSROOT3:

    jbsunsetcnf  -i -h LHOST -c JP1AJSMANAGER -n AJSROOT3
  4. Delete the directories that you created when you added the scheduler service.

    Delete the following directories that were created when you executed the jajs_setup command:

    • Database directory specified in the -d option

    • Directory for temporary files specified in the -t option

    • Job information directory specified in the -j option

    • Backup information directory specified in the -b option

    Important

    Do not delete the logical host shared directory specified in the -D option.

  5. If a trace log has been output per scheduler service, delete the trace log file for the deleted scheduler service.

    If yes is set in the TRACELOGDIV environment setting parameter, a trace log is output for individual scheduler services. In that case, trace log files are output with the name tracelog_scheduler-service-name to the folder specified in the TRACELOGDIVDIR environment setting parameter. Therefore, delete the trace log file for the deleted scheduler service.

  6. Start the JP1/AJS3 services.

    Restart the JP1/AJS3 services that you stopped in step 1, and confirm that the scheduler service has been deleted.

(3) Uninstalling a database environment that is no longer necessary

For details about how to uninstall a database environment that is no longer necessary, see 6.1.1(3) Uninstalling an unnecessary database environment.

(4) Renaming a scheduler service

Renaming a scheduler service affects many types of JP1/AJS3 functions. For example, a unit might end abnormally or might not be executed properly. To prevent such problems, we recommend that you rename a scheduler service before operation starts.

To rename a scheduler service in a cluster environment, you must execute the jajs_setup command on both the primary node and secondary node. You must execute the jajs_setup command on the secondary node before the common definition information for the primary node is applied to the secondary node.

To rename a scheduler service in a cluster environment:

  1. On the primary node, rename the scheduler service.

    The procedure varies depending on whether you rename the scheduler service before or after operation starts. For details about this procedure, see (a) How to rename a scheduler service before operation starts or (b) How to rename a scheduler service after operation starts.

  2. On the primary node, execute the following command to save the common definition information for the logical host that contains the new scheduler service name.

    jbsgetcnf -h logical-host > backup-file

    For details on the jbsgetcnf command, see the JP1/Base User's Guide.

  3. On the secondary node, rename the scheduler service.

    The procedure varies depending on whether you rename the scheduler service before or after operation starts. For details about this procedure, see (a) How to rename a scheduler service before operation starts or (b) How to rename a scheduler service after operation starts.

  4. On the secondary node, execute the following command to apply the logical host common definition information you saved in step 2.

    jbssetcnf backup-file

    For details on the jbssetcnf command, see the JP1/Base User's Guide.

The following describes how to rename a scheduler service before and after operation starts.

(a) How to rename a scheduler service before operation starts

To rename a scheduler service before operation starts:

  1. Execute the jajs_setup command to rename the scheduler service.

    Execute the following command:

    jajs_setup -r -F scheduler-service-name-before-the-change -A new-scheduler-service-name

    For details about the jajs_setup command, see jajs_setup in 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

(b) How to rename a scheduler service after operation starts

To rename a scheduler service after operation starts:

  1. Stop the scheduler service to be renamed, and then cold-start the scheduler service.

    After the cold-start, do not register a jobnet for execution until the renaming procedure is finished.

  2. Stop the JP1/AJS3 services on the physical host and all logical hosts.

  3. Execute the ajsshmdel command to delete the shared memory information.

    The path to the ajsshmdel command is /opt/jp1ajs2/bin/ajsshmdel.

    Example:

    For sh: /opt/jp1ajs2/bin/ajsshmdel >/dev/null 2>&1

    For csh: opt/jp1ajs2/bin/ajsshmdel >&/dev/null

  4. Execute the jajs_setup command to rename the scheduler service.

    Example: To change AJSROOT2 to AJSROOT5:

    jajs_setup -r -F AJSROOT2 -A AJSROOT5

    If the KAVS1133-W message is not output during execution of the jajs_setup command, skip step 5 and step 6 and go to step 7.

    If the KAVS1133-W message is output during execution of the jajs_setup command, check the setting name indicated in the message. If Local date and time is indicated, go to step 5. If Suspend feature is indicated, go to step 6, and then proceed to step 7.

    Cautionary note:

    Before you rename a scheduler service for which the local date and time is set, obtain the difference between the local date and time for the scheduler service and the system date and time. Use the ajslocaldate command to obtain the scheduler service local date and time.

    For details about how to obtain the system date and time, see the documentation for your OS.

    If an attempt to set the scheduler service local date and time fails and the KAVS1133-W message appears, use the time difference obtained above to set the scheduler service local date and time in step 5.

  5. Set the scheduler service local date and time again.

    Execute the ajslocaldate command to set the scheduler service local date and time for the renamed scheduler service.

    Example: To set the local date and time for the scheduler service AJSROOT5 forward five minutes (300 seconds) from the current time, execute the command as follows:

    ajslocaldate -F AJSROOT5 -s 300

    For details about the ajslocaldate command, see ajslocaldate in 4. Commands Used for Special Operation in the manual JP1/Automatic Job Management System 3 Command Reference.

  6. Set the suspend function again.

    Execute the ajssetup command to enable the suspend function for the renamed scheduler service. For a cluster environment, perform this step on either the primary node or the secondary node that can access the shared disk.

    Example: To enable the suspend function for the scheduler service AJSROOT5, execute the command as follows:

    ajssetup -F AJSROOT5 -m

    For details about the ajssetup command, see ajssetup in 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

  7. If the scheduler service name before the change is set for the following environment setting parameters, use the jajs_config command to change them to the new scheduler service name.

    Table 17‒7: Environment setting parameters whose settings need to be changed

    Definition key

    Environment setting parameter

    Explanation

    [JP1_DEFAULT\JP1AJSMANAGER]

    "DEFAULTSERVICENAME"=

    Default scheduler service name

    "REMNETSERVICENAME"=

    Name of the scheduler service that executes a remote jobnet

    Example: To change the default scheduler service name to AJSROOT5, execute the command as follows:

    jajs_config -k "[JP1_DEFAULT\JP1AJSMANAGER]" "DEFAULTSERVICENAME"="AJSROOT5"

    Example: To change the name of the scheduler service that executes remote jobnets to AJSROOT5, execute the command as follows:

    jajs_config -k "[JP1_DEFAULT\JP1AJSMANAGER]" "REMNETSERVICENAME"="AJSROOT5"

  8. If a trace log has been output per scheduler service, change the name of the trace log file used for each scheduler service before changing the scheduler service name.

    If yes is set in the TRACELOGDIV environment setting parameter, a trace log is output for individual scheduler services. In that case, trace log files are output with the name tracelog_scheduler-service-name to the folder specified in the TRACELOGDIVDIR environment setting parameter. Therefore, change the scheduler-service-name part from the scheduler service name before the change to the new scheduler service name.

  9. Start the JP1/AJS3 services.

  10. In either of the following cases, after the scheduler services start, change or set the scheduler service settings if necessary:

    • The scheduler service name before the change is specified in the unit definition.

    • The JP1/AJS3 linkage facility was monitoring or collecting information from the scheduler service before it was renamed.

(c) Notes on renaming scheduler services

The following environment setting parameters for scheduler services use the directory path that contains the scheduler service name as a standard:

  • AJSSYSDIR

  • AJSLOGDIR

  • AJSDBDIRECTORY

  • AJSLOGFILE1

  • AJSLOGFILE2

  • AJSTMPDIR

  • JOBINFDIR

Operation is not affected even if the environment setting parameters are not changed after the scheduler service is renamed. However, if necessary, consider changing the directory path that contains the new scheduler service name.

When you change the setting of the AJSDBDIRECTORY environment setting parameter in an environment using the suspend function or queueless jobs, you must reset the suspend or queueless job function after changing the parameter setting. Perform resetting on one of the primary and secondary nodes in which the shared disk can be referenced.

Use the jajs_config command to change the environment setting parameters. For details about the jajs_config command, see jajs_config in 2. Commands Used during Setup in the manual JP1/Automatic Job Management System 3 Command Reference.

For details about the parameters, see 20.4 Setting up the scheduler service environment.