Summary: Usage of SLA parameters to deploy an application with Primary and Backup setup.

Overview

This example shows how the SLA parameters can be used. It demonstrates the usage of SLA parameters to deploy an application into Primary and Failover (Disaster Recovery) datacenters and spread them in such a way that active Processing Units (PU) run in the primary datacenter and backups PU's run in the failover datacenter.

Customize pu.xml file

The space is defined using the following bean definition:

<os-core:space id="space" url="/./myPartitionedSpace" />

Application needs 2 instances of the space and 1 back-up. Two PU instances cannot be on the same JVM and two primaries cannot be on the same machine. This can be done using the following SLA definition:

<os-sla:sla cluster-schema="my-partitioned-sync2backup" number-of-instances="2" number-of-backups="1" 
max-instances-per-vm="1" max-instances-per-machine="1">

Another application requirement is to associate/allocate the active PU?s in primary datacenter machines and backups on the failover datacenter machines. This can be defined using Software requirement for each PU instance. For example, the active PU instance 1 represented as instance-id 1, is defined with a software requirement as below:

<os-sla:instance-SLA instance-id="1">
	<os-sla:requirements>
		<os-sla:system name="SoftwareSupport">
		    <os-sla:attributes>
			<entry key="DataCenter" value="Primary" />
		    </os-sla:attributes>
		</os-sla:system>
	</os-sla:requirements>
</os-sla:instance-SLA>

Starting GSC with Override file

The GSC can be started with a set of capabilities. Here is the XML override file that can be used when starting a GSC in the Primary Datacenter:

<overrides>
    <Component Name="org.jini.rio.qos">
        <Parameter Name="addPlatformCapabilities">
        <![CDATA[
        new org.jini.rio.qos.capability.PlatformCapability[] {            
            new org.jini.rio.qos.capability.software.SoftwareSupport(
                new Object[]{"Name", "XXX","DataCenter", "Primary"})
            }
        ]]>
        </Parameter>
    </Component>
</overrides>

The above override adds "Software Support" for a DataCenter called Primary. Here is script to start this GSC using override file (file name is PrimaryDataCenter-override.xml)
Linux:

gsc.sh ../config/overrides/PrimaryDataCenter-override.xml

Windows:

gsc.bat ..\config\overrides\PrimaryDataCenter-override.xml

When application is deployed, GSM analyzes the requirement of each PU and allocates them on the PU that supports this requirement.

Example Package Content

The example includes:

File/Folder Description
Readme.txt readme file with deployment and run instructions
DisasterRecoveryDataCenter-override.xml The override file
my-partitioned-sync2backup-cluster-schema.xsl The cluster schema
PrimaryDataCenter-override.xml The override file
partitioned-cluster-max-per-mc The processing unit folder
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence