Configuring the scheduler to run a job on an instance or cluster member (Business Edition)

You can configure the WebSphere Commerce scheduler to run a job on a particular WebSphere Commerce instance or cluster member. The following example demonstrates how to configure the scheduler in to do so. To isolate a scheduled job to a particular instance or cluster member, you need to:

Uniquely Identifying a Scheduler Process

To identify the scheduler process, you need to open the instance_name.xml file for the instance. In the WebServer node of the instance configuration, there is a HostName parameter that corresponds to the host configuration parameter of the scheduled job. Each instance should have a unique value for this parameter to uniquely identify the instance. If each instance has the same value, you must manually modify the instance.xml file for the instance, as shown:

<WebServer AuthenticationMode="Basic"
               DocumentRoot="E:\WebSphere\httpd\htdocs"
               HostName="tomato.veggiefarm.org"
               NESNonSecureConf=""
               NESSecureConf=""
               NESToolsConf=""
               RemoteWS="false"
               ServerPort="80"
               StoresWebPath="/webapp/wcs/stores/servlet"
               WebServerType="HTTP">

There are cases where changing the HostName parameter is not possible because this parameter is used by the other components. This value can be overridden by specifying the host name in the Scheduler component configuration. The following example is the XML section of the scheduler configuration, and the hostName property needs to be added to override the host name value found in the WebServer configuration section. This property is case sensitive and is not specified when the instance is initially created.

<component compClassName="com.ibm.commerce.scheduler.SchedulerComm" enable="true" name="Scheduler">
       <property autoClean="off"
                 broadcastExpireTime="1800"
                 cycleTime="600"
                 hostName="spinach.veggiefarm.org"
                 display="false">
          <applicationType applicationName="default"
                           maxNumofThreads="10" />
          <applicationType applicationName="broadcast"
                           maxNumofThreads="10" />
          <applicationType applicationName="auction"
                           maxNumofThreads="10" />
          <applicationType applicationName="inventory"
                           maxNumofThreads="10" />
      </property>
</component>

In the case of vertical cloning, where the two instances share the same instance_name.xml file, the following JVM parameter will override the host name value:

com.ibm.commerce.scheduler.SchedulerHostName

This value can be specified using the WebSphere administration console and specifying this system property in the JVM settings of the WebSphere Commerce application:

  1. Log onto the WebSphere Administrative Console.

  2. Select Servers > Application Servers.

  3. Select WC_instance name > Process Definition > Java Virtual Machine > Custom Properties

  4. Click New. A new page opens for you to add additional JVM properties.

  5. In the Name field, enter com.ibm.commerce.scheduler.SchedulerHostName.

  6. In the Value field, enter the unique identifier of the scheduler instance on this Java process.

  7. (Optional) In the Description field, enter the host name parameter for this scheduler instance to use.

Note: In many cases, the host name parameter is just the first part of the machine's host name. In previous versions of WebSphere Commerce, the AddJob command requires the host name to have a format of hostname.domain name, as in "tomato.veggiefarm.org". If you do not want to have this particular format, you need to update the SCHCONFIG record manually by modifying the SCCHOST column to the corresponding host value.

To create a job to run on a particular host, when calling the AddJob command to create the new schedule job, specify the host parameter and use the value that uniquely identifies the scheduler process that should execute the scheduled job.

If you want to manually change an existing job, update the SCCHOST column in the SCHCONFIG table for the job you want to run on a particular instance. When changing the SCCHOST column, ensure that the value is specified in lowercase characters. Because of performance reasons, the scheduler assumes that the host parameter will be specified in lowercase. The AddJob command makes the host value lowercase automatically but there is nothing in place at the database to maintain this restriction.

Feedback