This chapter includes the following sections:
A resource group template is a named, domain-level collection of deployable resources intended to be used as a pattern by multiple resource groups. Each resource group that refers to (references) a given template will have its own runtime copies of the resources defined in the template.
A resource group template is a convenient way to define and replicate resources for multiple tenants. Resource group templates make it very easy to deploy the same collection of applications and resources to multiple domain partitions.
Resource group templates are particularly useful in a Software-as-a-Service environment where WebLogic Server Multitenant (MT) activates the same applications and resources multiple times, once per domain partition. Some of the information about such resources is the same across all domain partitions, while some of it, such as the attributes of a Java Message Service (JMS) queue or of a database connection, varies from one partition to another.
You can create a resource group template in two ways:
Create a new resource group template. This creates the basic structure for the resource group template. You must then edit this resource group template as needed.
If you are using the Oracle WebLogic Server Administration Console, then you can clone (copy) an existing resource group template. The configuration is copied from the template to the new resource group template. You must then edit and override values from the resource group template as needed.
This section includes the following topics:
One major difference between resource group templates and resource groups is that resource group templates do not have targets. Because resource group templates are intended to be used only as a pattern by multiple resource groups, possibly in many partitions, any target-specific information will most likely be unique to the resource group.
Therefore:
If you deploy applications to the resource group template, then you cannot start the applications until the resource group template is referenced by a resource group.
You cannot start or stop a resource group template.
Resource group templates are based on the ResourceGroupTemplateMBean
and can include the following resources:
General (name)
Deployments
Services
Java Database Connectivity (JDBC)
Messaging
Mail sessions
Persistent stores
Foreign Java Naming and Directory (JNDI) providers
OSGi frameworks
Diagnostics
Notes
Overriding resources lets you customize resources at the partition level.
You override resource settings that are derived from a resource group template as follows:
Create the resource group template.
Deploy applications to the resource group template as needed.
Define services in the resource group template as needed.
Create a partition and then create a resource group that references the resource group template.
Override the values from the resource group template in the resource group.
You can override resource definitions in partitions using override configuration MBeans, resource deployment plans, and partition-specific application deployment plans. For more information about resource overrides, see Configuring Resource Overrides. For information about application overrides, see Deploying Applications to Partition Resource Groups.
Assume that you have a SaaS environment, and that you want to run an instance of a specific business application in three different partitions. This business application requires a pluggable database, which means you need one pluggable database per partition because each application instance needs its own data isolated from the other application instances.
Assume further that the configuration for the pluggable databases will be identical for the three partitions, with the exception of the database name, user name, and password. For these values, plan to use the values from Table 4-1.
Table 4-1 Example Pluggable Databases
PDB Name | User name/Password | For Use by |
---|---|---|
|
pdbuser1/pdbuser1 |
Partition1 |
|
pdbuser2/pdbuser2 |
Partition2 |
|
pdbuser3/pdbuser3 |
Partition3 |
To configure your resource group template, follow these steps:
To create a new resource group template:
Go to Domain > Environment > Resource Group Templates.
Create a new resource group template. The name must be unique in the domain.
These tasks are described in "Create resource group templates" in Administering Oracle WebLogic Server with Fusion Middleware Control.
The initial resource group template configuration is a basic skeleton and you must configure it before you can use it. The tasks include configuring JDBC system data sources, JMS servers and resources, foreign JNDI providers, and so forth.
For more information, see Configuring Resource Group Templates: Main Steps and WLST Examples.
The example does the following:
# Create Pep partition resource group, and resource group template edit() startEdit() wls:/base_domain/edit/ !> domain=getMBean('/') wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep') wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0') wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String)) wls:/base_domain/edit/ !> vt.setUriPrefix('/foo') wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt) wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG') wls:/base_domain/edit/ !> peprg.addTarget(vt) wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT') wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt) wls:/base_domain/edit/ !> activate() wls:/base_domain/edit/ !> startPartitionWait(peppart)
This section includes the following tasks:
To view and define resource group template deployment settings:
These tasks are described in "Configure resource group template deployments" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Deploying Applications to Resource Group Templates.
This section includes the following tasks:
To view configuration settings for the JDBC system resources that have been created in this resource group template:
For more information, see Configuring JDBC.
This section includes the following tasks:
To view configuration settings for the JMS servers that have been created for this resource group template:
These tasks are described in "WebLogic Server Messaging" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To view configuration settings for the store-and-forward (SAF) agents that have been created for this resource group template:
These tasks are described in "Configure SAF Agent Settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To monitor the resource settings for a resource group template:
These tasks are described in "Configure SAF Agent Settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For information about configuring existing JMS resources, see Configuring Messaging.
To configure the JMS modules for a resource group template:
These tasks are described in "Configure JMS module settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To configure the messaging bridge settings for a resource group template:
These tasks are described in "Configure messaging bridges" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To configure the JMS bridge destination settings for a resource group template:
These tasks are described in "Configure JMS bridge destinations" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To configure the path services settings for a resource group template:
These tasks are described in "Configure path services" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To view configuration settings for the mail sessions that have been created in this resource group template:
These tasks are described in "WebLogic Server Mail Sessions" in Administering Oracle WebLogic Server with Fusion Middleware Control.
To view configuration settings for the persistent stores that have been created in this resource group template:
These tasks are described in "WebLogic Server Persistent Stores" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring Messaging.
To view configuration settings for the foreign JNDI providers that have been created in this resource group template:
These tasks are described in "WebLogic Server Foreign JNDI Providers" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Configuring and Programming JNDI.
To view configuration settings for the diagnostic system modules that have been created in this resource group template:
These tasks are described in "WebLogic Server Diagnostics" in Administering Oracle WebLogic Server with Fusion Middleware Control.
For more information, see Monitoring and Debugging Partitions.
To create notes for a resource group template:
The example does the following:
# Create Pep partition resource group, and resource group template edit() startEdit() wls:/base_domain/edit/ !> domain=getMBean('/') wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep') wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0') wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String)) wls:/base_domain/edit/ !> vt.setUriPrefix('/foo') wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt) wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG') wls:/base_domain/edit/ !> peprg.addTarget(vt) wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT') wls:/base_domain/edit/ !> deploy(appName='MySimpleEJB', path='c:/webservices/MySimpleEjb.jar', resourceGroupTemplate='TestRGT') wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt) wls:/base_domain/edit/ !> activate() wls:/base_domain/edit/ !> startPartitionWait(peppart)
If a resource group template is referenced by resource groups, then you need to remove the references before deleting this resource group template:
Select the resource group that you want to delete.
Delete the resource group.
The example does the following:
# Create Pep partition resource group, and resource group template edit() startEdit() wls:/base_domain/edit/ !> domain=getMBean('/') wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep') wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0') wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String)) wls:/base_domain/edit/ !> vt.setUriPrefix('/foo') wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt) wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG') wls:/base_domain/edit/ !> peprg.addTarget(vt) wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT') wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt) wls:/base_domain/edit/ !> peprg.unSet('ResourceGroupTemplate') wls:/base_domain/edit/ !> domain.destroyResourceGroupTemplate(peprgt) wls:/base_domain/edit/ !> activate() wls:/base_domain/edit/ !> startPartitionWait(peppart)