WebSphere eXtreme Scale (formerly Data Grid), Version 6.1
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


createPolicy

The createPolicy parameter is used to create a policy.

The following scenario is an example of incorporating policies to manage partitions. The wpfadmin parameter, createPolicy, is used to create four policies. The cluster has four servers that host partitions on four different nodes:
  • NodeA/Server1
  • NodeB/Server2
  • NodeC/Server3
  • NodeD/Server4
Each node has a backup server in case the hosting server goes down. These servers are:
  • NodeA/BackupServer1
  • NodeB/BackupServer2
  • NodeC/BackupServer3
  • NodeD/BackupServer4
An application is installed that creates 40 partitions at startup. The partitions belong to four different classifications:
  • Activate partitions1-10 (classification=class1) on NodeA/Server1
  • Activate partitions11-20 (classification=class2) on NodeB/Server2
  • Activate partitions21-30 (classification=class3) on NodeC/Server3
  • Activate partitions 31-40 (classification=class4) on NodeD/Server4
To achieve this activation request, four policies are created:
  • Policy1
  • Policy2
  • Policy3
  • Policy4
From the application server bin directory, issue the command:
./wpfadmin createPolicy /Policy1.properties
The Policy1.properties file contains the following.
CoreGroupName = DefaultCoreGroup
PolicyType = OneOfNPolicy
PolicyName = Policy1
PolicyDescription = Policy for partitions1-10
IsAlivePeriodSec = 120
QuorumEnabled = false
NumOfMatchCriteria = 2
Name_0 = -gt
Value_0 = -p
Name_1 = -pc
Value_1 = class1
Failback = true
PreferredOnly = true
NodeName_0 = NodeA
ServerName_0 = Server1
NodeName_1 = NodeA
ServerName_1 = BackupServer1
Run ./wpfadmin createPolicy /Policy2.properties with the following information in the Policy2.properties file.
CoreGroupName = DefaultCoreGroup
PolicyType = OneOfNPolicy
PolicyName = Policy2
PolicyDescription = Policy for partitions11-20
IsAlivePeriodSec = 120
QuorumEnabled = false
NumOfMatchCriteria = 2
Name_0 = -gt
Value_0 = -p
Name_1 = -pc
Value_1 = class2
Failback = true
PreferredOnly = true
NodeName_0 = NodeB
ServerName_0 = Server2
NodeName_1 = NodeB
ServerName_1 = BackupServer2
Issue ./wpfadmin createPolicy /Policy3.properties with the following in Policy3.properties.
CoreGroupName = DefaultCoreGroup
PolicyType = OneOfNPolicy
PolicyName = Policy3
PolicyDescription = Policy for partitions21-30
IsAlivePeriodSec = 120
QuorumEnabled = false
NumOfMatchCriteria = 2
Name_0 = -gt
Value_0 = -p
Name_1 = -pc
Value_1 = class3
Failback = true
PreferredOnly = true
NodeName_0 = NodeC
ServerName_0 = Server3
NodeName_1 = NodeC
ServerName_1 = BackupServer3
Run ./wpfadmin createPolicy /Policy4.properties with the following information in the Policy4.properties file.
CoreGroupName = DefaultCoreGroup
PolicyType = OneOfNPolicy
PolicyName = Policy4
PolicyDescription = Policy for partitions31-40
IsAlivePeriodSec = 120
QuorumEnabled = false
NumOfMatchCriteria = 2
Name_0 = -gt
Value_0 = -p
Name_1 = -pc
Value_1 = class4
Failback = true
PreferredOnly = true
NodeName_0 = NodeD
ServerName_0 = Server4
NodeName_1 = NodeD
ServerName_1 = BackupServer4
Notice the match criteria for the four policies. They are set up in name/value pairs.
  • -gt=-p - denotes that the group type is type partition.
  • -pc=class4 - denotes this policy only applies to partitions that have classification class4

Now the core group is set up with the four policies. Start the node agents on nodes A-D. After a short interval, the core group changes are synchronized to all the nodes. Assuming that the application is already installed, when Server1 is started partitions1-10 are activated on Server1 because Policy1 has the preferredOnly value set to true Partitions1-10 can only be started on Server1 and BackupServer1. If BackupServer1 is started before Server1, partitions1-10 are activated on BackupServer1. If neither Server1 or BackupServer1 are started, the partitions are not activated.

This situation explains how the preferredOnly and preferred servers work. When the failback option is set to true, the partitions for the policy are always activated on the preferred server. If partitions1-10 are active on Server1, then Server1 goes down, the partitions activate on BackupServer1. If in the future Server1 comes up, the partitions go back to Server1, because this server is first in the preferred server list.

Consider the following server startup scenarios:
  • Server2 starts and partitions11-20 activate on Server2
  • Server3 starts and partitions21-30 activate on Server3
  • BackupServer3 starts and nothing happens, because Server3 is already running and it is before BackupServer3 in Policy3's preferred server list
  • BackupServer1 starts and partitions 1-10 activate on BackupServer1
  • BackupServer2 starts and nothing happens, because Server2 is already running and it is before BackupServer2 in Policy1's preferred server list
  • BackupServer4 starts and partitions 31-40 activate on BackupServer4.
  • Server1 starts - partitions1-10 deactivate on BackupServer1 and activate on Server1, since failback is set to true and Server1 is before BackupServer1 in Policy1's preferred server list
  • Server4 starts - partitions31-40 deactivate on BackupServer4 and activate on Server4, since failback is set to true and Server4 is before BackupServer4 in the Policy4 preferred server list.



Related concepts
Management script wpfadmin and usage
Reference topic    

Terms of Use | Feedback

Last updated: Oct 30, 2009 6:09:57 PM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1/index.jsp?topic=/com.ibm.websphere.dataint.doc/info/WPF51/rwpfcreatePolicy.html