Creating a Decision Server Events runtime in WebSphere Operational Decision Management V7.5, Part 2: Configuring a highly available and scalable environment

This two-part series describes how to create a Decision Server Events environment in WebSphere Operational Decision Management V7.5. Part 1 walked you through the steps for building a standalone environment. Part 2 takes you through the steps for building a highly available and scalable environment. This content is part of the IBM Business Process Management Journal.

Shenfu (Mike) Fan (sfan@us.ibm.com), Certified IT Architect and IT Specialist, IBM

Photo of Shenfu (Mike) FanShenfu (Mike) Fan is a Senior Managing Consultant with IBM Software Services for WebSphere (ISSW). He is primarily focused on architectural design, development, and implementation of enterprise application integration solutions using WebSphere products that include WebSphere Message Broker, WebSphere MQ, WebSphere Business Events, WebSphere Service Registry and Repository, WebSphere ESB, and others.


developerWorks Contributing author
        level

Tim Galvin (tgalvin@us.ibm.com), Software Developer, IBM

Tim Galvin photoTim Galvin is a Software Developer with the IBM WebSphere Business Events development team in the Littleton Software Lab in MA. He previously worked as a senior consultant, leading customers in the architecture, design, and implementation of WebSphere Business Events solutions.



12 December 2012

Also available in Chinese

Introduction

WebSphere Operational Decision Management (hereafter called ODM) enables businesses to respond to real-time data with intelligent, automated decisions. It consists of two complementary components, Decision Server Rules and Decision Server Events. Depending on business data types and business requirements, Decision Server Events can be used to provide decision management services. Because Decision Server Events is the new version of WebSphere Business Events, WebSphere Business Events V7 users may want to migrate their solutions to ODM to leverage new tools and features.

You can configure either a standalone or highly available and scalable Decision Server events environment. One approach to creating a highly available and scalable events environment is to use application server clustering to provide workload management and failover for applications that reside on the cluster. In this article, we'll create a clustered Decision Server events environment. Refer to Part 1 for the steps to build a standalone environment.

To benefit from this article, readers should have a fundamental understanding of WebSphere ODM and WebSphere Application Server products. For more information on these products, see Resources.


Create a Decision Server Events runtime

Refer to the WebSphere Operational Decision Management Information Center for a silver topology and a golden topology for a highly available and scalable Decision Server Events runtime (hereafter called event runtime). In either topology, the default messaging (the application server SIBus) is used as the JMS provider. In the topology shown in Figure 1, WebSphere MQ is used as the JMS provider and DB2® is used for the event runtime repository. MQ and DB2 servers are hosted on separated machines. The event runtime environment is created on an application server cluster across two hosts, which provide mission-critical services to ensure minimal downtime and maximum scalability. A cluster is a group of application servers that transparently run the event runtime, a Java™ EE application, as if it were a single entity. Multi-instance queue managers along with client channel definition table (CCDT) could be used for the messaging failover by automatically switching to a standby MQ server if the active server fails. DB2 high availability disaster recovery (HADR) could be used for the data source failover. The DB2 HADR is a data replication feature that provides a high availability solution for both partial and complete site failures. Creating multi-instance queue managers and configuring DB2 HADR are outside the scope in this article.

Figure 1. An event runtime topology using MQ and DB2
An event runtime topology using MQ and DB2

For the sake of simplicity, we'll build an event runtime environment on one Windows® machine, as shown in Figure 2. ODM, MQ and DB2 are all installed on the machine. One cluster DseCluster1 contains the two managed nodes (custom profiles augmented with Decision Server Events) DseNode1 and DseNode2, which are federated into a cell DseCell1 of a deployment manager DseDmgr1. Table 1 lists the prerequisite software and installation information.

Figure 2. Logical view of the event runtime environment
Logical view of the event runtime environment
Table 1. Software installation information
SystemParameterValue
WebSphere ODMVersion
Host
Install_Dir
WAS_Dir
UserID
7.5
localhost
C:\IBM\WODM75
C:\IBM\WODM75\WAS
admin
WebSphere MQVersion
Host
Install_Dir
UserID
7.0.1
localhost
C:\IBM\MQV70
admin
DB2Version
Host
Install_Dir
Server_Port
UserID
9.7
localhost
C:\IBM\SQLLIB
50000
admin

Before creating the event runtime, you need to create a database and a queue manager as follows:

  1. Create a database called DSEDB1 by entering the following DB2 Command Line Processor (CLP) command:
    db2 create database DSEDB1 using codeset UTF-8 territory us PAGESIZE 32768
  2. Create a queue manager DSEQM1 along with a listener and pub/sub JMS objects using the following commands:
    crtmqm DSEQM1
    strmqm DSEQM1
    echo DEFINE LISTENER('DSEQM1_TCP') TRPTYPE(TCP) PORT(2414) CONTROL(QMGR)
    | runmqsc DSEQM1
    runmqsc DSEQM1 < C:\IBM\MQV70\java\bin\MQJMS_PSQ.mqsc

After the database and the queue manager are successfully created, follow the steps described below to create the event runtime.

  1. Create and augment a deployment manager profile
  2. Create and augment custom profiles
  3. Federate the custom profiles into the cell of the deployment manager
  4. Create a cluster and add the application servers as cluster members
  5. Start the deployment manager, the node agents and the cluster
  6. Install the event runtime application
  7. Create a JVM custom property
  8. Enable the startup bean service
  9. Create DSE tables
  10. Create MQ queues
  11. Configure Business Space

Create and augment a deployment manager profile

Run the following command to create a deployment manager profile called DseDmgr1.

C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -create 
-templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\management" 
-profileName "DseDmgr1" 
-profilePath "C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1" 
-hostName "localhost" 
-cellName "DseCell1" 
-enableAdminSecurity "true"
-adminUserName "admin"
-adminPassword "p@ssw0rd"

You also can use the Profile Management Tool to create the deployment manager profile. For the WebSphere Application Server Information Center for information on how to create a management profile with a deployment manager.

Run the following command to augment the deployment manager profile with Decision Server Events.

C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -augment 
-profileName "DseDmgr1" 
-templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\wbe\management" 
-wbeDbType "DB2_Universal" 
-wbeDbHostName "localhost" 
-wbeDbServerPort "50000" 
-wbeDbJDBCClasspath "C:\IBM\SQLLIB\java\db2jcc.jar" 
-wbeDbName "DSEDB1" 
-wbeDbUserId "admin" 
-wbeDbPassword "p@ssw0rd" 
-wbeHome "C:\IBM\WODM75\WODM"
-wbeMsgingType "MQ_JMS_Messaging"
-wbeMqMsgingQmgrName "DSEQM1"
-wbeMqMsgingQmgrHostName "localhost"
-wbeMqMsgingQmgrPort "2414"
-wbeMqMsgingTransType "CLIENT"

Note that the MQ transport type can be BINDINGS or CLIENT. To connect to a queue manager in bindings mode, a JMS application must run on the same system on which the queue manager is running and connect directly to the queue manager using the Java Native Interface (JNI). To connect to a queue manager in client mode, a JMS application can run either on the same system on which the queue manager is running or on a different system. In each case, the JMS application connects to the queue manager over TCP/IP. If the multi-instance queue managers are used for failover, the type must be CLIENT so that CCDT on a channel can be set.

You also can use the Profile Management Tool to augment the deployment manager profile. Refer to the in WebSphere Operational Decision Management Information Center for information how to augment a management profile with Decison Server Events.

After the deployment manager profile is successfully created and augmented, start the application server and open the administrative console. You should see:

  • A deployment manager dmgr under System administration => Deployment manager.
  • A data source Event Runtime Datasource under Resources => JDBC => Data sources. This data source is associated with the database DSEDB1.
  • A set of JMS objects, such as the topic connection factory WbeTopicConnectionFactory under Resources => JMS => Topic connection factories, the queue eventQueue under Resources => JMS => Queues, the topic actionTopic under Resources => JMS => Topics, and the activation specification wbe_events under Resources => JMS => Activation specifications.
  • A set of Decision Server Events custom properties under Resources => Resource Environment => Resource environment entries => WbeSrv01 => Custom properties.

Create and augment custom profiles

Run the following command to create a custom profile called DSE1.

C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -create 
-templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\managed" 
-profileName "DSE1" 
-profilePath "C:\IBM\WODM75\WAS\AppServer\profiles\DSE1"
-nodeName "DseNode1"
-hostName "localhost"
-enableAdminSecurity "true"
-adminUserName "admin"
-adminPassword "p@ssw0rd"

Run the following command to augment the custom profile with Decision Server Events.

C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -augment 
-profileName "DSE1" 
-templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\wbe\managed"

Repeat both commands to create and augment another custom profile DSE2.


Federate the custom profiles into the cell of the deployment manager

Start the deployment manager if not already started, and run the following commands to federate the DSE1 and DSE2 custom profiles into the cell of the deployment manager.

C:\IBM\WODM75\WAS\AppServer\bin>addNode.bat localhost 8879 -profileName "DSE1" 
    -username admin 
    -password p@ssw0rd  
C:\IBM\WODM75\WAS\AppServer\bin>addNode.bat localhost 8879 -profileName "DSE2" 
    -username admin
    -password p@ssw0rd

where:
8879 is the deployment manager's SOAP_CONNECTOR_ADDRESS port number and localhost is the host name where the deployment manager is running.


Create a cluster and add the application servers as cluster members

Run the following commands to create a cluster called DseCluster1 in the DseCell1 cell and then add the cluster members DseSrv1 and DseSrv2 in the cluster.

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython 
    -username admin
    -password p@ssw0rd 
wsadmin>cell1 = AdminConfig.getid('/Cell:DseCell1/')
wsadmin>AdminConfig.create('ServerCluster', cell1, '[[name DseCluster1]]')
wsadmin>AdminConfig.save()   
wsadmin>cluster1 = AdminConfig.getid('/ServerCluster:DseCluster1/')    
wsadmin>node1 = AdminConfig.getid('/Node:DseNode1/')
wsadmin>node2 = AdminConfig.getid('/Node:DseNode2/')
wsadmin>AdminConfig.createClusterMember(cluster1, node1, [['memberName', 'DseSrv1']]) 
wsadmin>AdminConfig.createClusterMember(cluster1, node2, [['memberName', 'DseSrv2']]) 
wsadmin>AdminConfig.save()
wsadmin>exit

Start the deployment manager, the node agents, and the cluster

After completing the previous step, the deployment manager and the node agents should be up and running. If not, run the following commands to start the deployment manager and the node aganets for DSE1 and DSE2.

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startManager
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startNode -profileName DSE1
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startNode -profileName DSE2

Run the following commands to start the cluster:

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython 
    -username admin 
    -password p@ssw0rd
wsadmin>cluster1 = AdminControl.completeObjectName('cell=DseCell1,
    type=Cluster,
    name=DseCluster1,*')
wsadmin>AdminControl.invoke(cluster1, 'start')
wsadmin>exit

If you want to stop the cluster, the node agents, and the deployment manager, run the following commands.

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
    -username admin 
    -password p@ssw0rd
wsadmin>cluster1 = AdminControl.completeObjectName('cell=DseCell1,
    type=Cluster,
    name=DseCluster1,*')
wsadmin>AdminControl.invoke(cluster1, 'stop')
wsadmin>exit

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopNode -profileName DSE1 
    -username admin 
    -password p@ssw0rd

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopNode -profileName DSE2 
    -username admin 
    -password p@ssw0rd

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopManager -username admin 
    -password p@ssw0rd

Install the event runtime application

The event runtime application file wberuntimeear.ear is located in the C:\IBM\WODM75\WODM\director\lib directory. Make sure that the deployment manager, the node agents, and the cluster are all started. Run the following commands to install the application.

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython 
    -username admin
    -password p@ssw0rd
wsadmin>AdminApp.install('C:/IBM/WODM75/WODM/director/lib/wberuntimeear.ear',
                 '[-cluster DseCluster1]')
wsadmin>AdminConfig.save()
wsadmin>sync1 = AdminControl.completeObjectName('type=NodeSync,node=DseNode1,*')
wsadmin>sync2 = AdminControl.completeObjectName('type=NodeSync,node=DseNode2,*')
wsadmin>AdminControl.invoke(sync1, 'sync')
wsadmin>AdminControl.invoke(sync2, 'sync')
wsadmin>exit

Create a JVM custom property

The event runtime requires that a JVM custom property called wbe.home is configured with a value that is the location of the directory director in the Decision Server Events installation (in this case, C:\IBM\WODM75\WODM\director).

To create the JVM custom property for each application server in the cluster, run the following commands:

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
    -username admin
    -password p@ssw0rd
wsadmin>server1 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode1/Server:DseSrv1')
wsadmin>server2 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode2/Server:DseSrv2')
wsadmin>jvm1 = AdminConfig.list('JavaVirtualMachine', server1)
wsadmin>jvm2 = AdminConfig.list('JavaVirtualMachine', server2)
wsadmin>attr = []
wsadmin>attr.append([['name','wbe.home'],['value','C:\\IBM\\WODM75\\WODM\\director']])
wsadmin>AdminConfig.modify(jvm1,[['systemProperties',attr]])
wsadmin>AdminConfig.modify(jvm2,[['systemProperties',attr]])
wsadmin>AdminConfig.save()
wsadmin>exit

You should see the wbe.home property in the administrative console, as shown in Figure 3.

Figure 3. New custom property
New custom property in admin console

You may need to configure the heap size and the JVM garbage collection value to optimize the usage of memories. For example, set both Initial Heap Size and Maximum Heap Size to 1024 and set Generic JVM Arguments to -Xgcpolicy:gencon -Xmn1024M.


Enable the startup beans service

You also need to enable the startup beans service for each application server in the cluster. To enable the startup bean service, run the following commands.

C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
wsadmin>server1 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode01/Server:DseSrv1')
wsadmin>server2 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode02/Server:DseSrv2')
wsadmin>sbs1 = AdminConfig.list('StartupBeansService', server1)
wsadmin>sbs2 = AdminConfig.list('StartupBeansService', server2)
wsadmin>AdminConfig.modify(sbs1, [['enable', 'true']])
wsadmin>AdminConfig.modify(sbs2, [['enable', 'true']])
wsadmin>AdminConfig.save()
wsadmin>exit

You should see the Enable service at server startup checked in the administrative console, as shown in Figure 4.

Figure 4. Enabling the startup beans service
Fig4.jpg

Create the event runtime tables

Decision Server Events provides the scripts used to create the event runtime tables in the C:\IBM\WODM75\WODM\config\db directory. Run the following DB2 CLP commands to create the event runtime tables.

cd C:\IBM\WODM75\WODM\config\db
db2 connect to DSEDB1
db2 -tcf db2.sql

You should see a set of tables for the event runtime created in the DSEDB1 database, as shown in Figure 5.

Figure 5. The event runtime tables
The event runtime tables

Create MQ queues

Decision Server Events provides the script create_MQ_JMS_MQ_queues.mqsc used to create the MQ queues in the C:\IBM\WODM75\WODM\config\was directory. Run the following MQ script command to create the queues.

cd C:\IBM\WODM75\WODM\config\was
runmqsc DSEQM1 < create_MQ_JMS_MQ_queues.mqsc

Three queues, eventQueue, durableEventQueue and historyModuleQueue, are created in the DSEQM1 queue manager, as shown in Figure 6.

Figure 6. The queues for the messaging destinations
The queues for the messaging destinations

Configure Business Space

Business Space is the browser-based graphical user interface that enables business users to interact with content provided by ODM and other WebSphere products. It hosts the design authoring tool, the Decision widget, so that the policy managers and rule authors can author event rules. You can create a Business Space in the cluster environment. Refer to the Operational Decision Management Information Center for information on how to Configure Business Space for high availability and scalability.


Verify the event runtime system

After a few seconds, the cluster DseCluster1, the application servers DseSrv1 and DseSrv2, and the application wberuntimeear should all be running.

Alternatively, to start the cluster on the administrative console, select Servers => Clusters => WebSphere application server clusters, then select DSECluster1, and click Start.

Complete the following steps to verify the event runtime.

  1. Make sure that the DB2 server and the MQ queue manager are started.
  2. Start the deployment manager, the node agents and the cluster. Open the administrative console and make sure that they are all started successfully.
  3. Download the MeterReadings event project from the ODM Information Center. In the MeterReadings project, the current and previous values of meter readings are compared. If the latest meter reading is less than the previous one, an action is triggered.
  4. Open the Event perspective on Event Designer. Create an event runtime connection as shown in Figure 7. Use port number 9080 for DseSrv1. Note that you can also create an event runtime connection to DseSrv2 (port number 9081). Both are connected to the same event runtime repository.
    Figure 7. Create a new event runtime connection
    Create a new event runtime connection
  5. Deploy the event project to the event runtime by selecting Deploy from project file, as shown in Figure 8.
    Figure 8. Deploy a project
    Deploy a project
  6. Open MQ Explorer. Expand the queue manager DSEQM1, right-click Topic and select Test subscription, as shown in Figure 9.
    Figure 9. Open test subscription
    Open test subscription
  7. Enter actionTopic in the Topic field and click Subscribe to subscribe the topic, as shown in Figure 10.
    Figure 10. Subscribe to actionTopic
    Subscribe to actionTopic
  8. Put an event test message in the eventQueue queue using MQ Explorer, as shown in Figure 11.
    Figure 11. Put an event test message in the queue
    Put an event test message in the queue

    The test message is listed here:

    <?xml version="1.1" encoding="UTF-8"?>
    <connector
        name="WBE" version="6.2" xmlns="http://wbe.ibm.com/6.2/Event/New-meter-reading">
               <connector-bundle name="New meter reading" type="Event">
               	<SmartMeter-data>
               		<Customer-ID type="String">12345</Customer-ID>
    		        <meter-reading type="Real">1000</meter-reading>
               		<meter-reading-date type="DateTime">2012-05-25T20:03:10Z<
    				/meter-reading-date>
    		</SmartMeter-data>
               </connector-bundle>
               <system>VMXP03</system>
               <timestamp>2012-05-25T16:03:10.569-04:00</timestamp>
               <loginfo>This is an event from Decision
        Server</loginfo>
    </connector>

    Change the meter-reading value from 1000 to 800 in the test message and put it in the queue again.

  9. Check that an action is published as shown in Figure 12.
    Figure 12. The action message published by the event runtime
    The action message published by the event runtime

Conclusion

This article described the steps to create a highly available and scalable event runtime environment. Though we built this environment on a single Windows machine, the commands and scripts provided can be used to build the topology across multiple machines as shown in Figure 1 and on other platforms, such as AIX. To build a real-world event runtime production environment, you'll need to performa additional configuration, such as user roles and user authentication.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=851061
ArticleTitle=Creating a Decision Server Events runtime in WebSphere Operational Decision Management V7.5, Part 2: Configuring a highly available and scalable environment
publish-date=12122012