8 Configuring Domain Partitions

This chapter describes how to create, configure, and manage domain partitions. You can use either Fusion Middleware Control (FMWC), WLST, or REST, as described in this chapter. The chapter refers to the Fusion Middleware, Coherence, and Oracle Traffic Director documentation sets and online help for additional information as appropriate.

This chapter includes the following sections:

Configuring Domain Partitions: Overview

WebLogic Server Multitenant (MT) implements an administrative and runtime slice of a domain, called a domain partition. A domain partition is a portion of a Weblogic domain that is dedicated to running application instances and related resources.

You can create any number of domain partitions within a domain.

Note:

Oracle generally recommends no more than 10 partitions within a domain for best performance. However, your particular server environment may support a much higher number of partitions.

Creating Domain Partitions: Prerequisites

Before you can create a domain partition, you must satisfy the following prerequisites:

  1. If you have not already done so, create the domain you plan to use.

    Use the Oracle Enterprise Manager - Restricted JRF template to create the domain. This template automatically includes several other necessary templates.

    The best practice is to create a new domain. If you plan to upgrade an existing domain, you must still create a new security realm as described in Configuring Security.

    Note:

    If you use Fusion Middleware Control or the WLS Administration Console, there is nothing specific to WebLogic Server MT when creating a cluster.

    However, if you use WLST to create Managed Servers (configured or dynamic), the required JRF template is not applied. When you subsequently use Fusion Middleware Control to monitor the domain, monitoring does not work for the servers without the JRF template.

    Therefore, for the WLST use case:

    1. Use WLST to create the cluster or Managed Server.

    2. Use the applyJRF command described in WLST Command Reference for Infrastructure Components to apply the JRF template to the Managed Servers.

  2. Set the deployment mode for lifecycle management. You can perform this step from the WLS Administration Console or WLST.

    From the WLS Administration Console:

    1. In the navigation pane, select the domain.

    2. Select the Configuration > General page.

    3. Expand the Advanced control.

    4. Change the Lifecycle Management Services Availability control to Local Admin Server.

    5. This is a non-dynamic change. Restart the Administration Server.

    From WLST:

    edit()
    startEdit()
    cd('/LifecycleManagerConfig/mydomain') 
    cmo.setDeploymentType('admin') 
    activate() 
    

    This is a non-dynamic change. Restart the Administration Server.

  3. If you have not already done so, create the security realm for the partition. Each partition must have a security realm. See Configuring Security for the steps to follow.

  4. If you have not already done so, create one or more virtual targets. See Configuring Virtual Targets for the steps to follow.

  5. If you want to use a resource group template with this domain partition, create the resource group template first. See Configuring Resource Group Templates for the steps to follow.

  6. If you are using OTD for load balancing, register the OTD runtime configuration.

Oracle Traffic Director: WebLogic Server Plug-in Enabled Prerequisite

If you are using OTD for load balancing, you must set the WebLogic Plug-in Enabled control in the WLS Administration Console.

You can set this control at one of three levels. The levels have a hierarchy. Setting it at one level serves as the default for the level below; setting it at the level below overrides the setting at the higher level. The levels are:

  • Domain level—setting it at the domain level sets it for each cluster and Managed Server within the domain.

  • Cluster level—setting it at the cluster level applies it to all the Managed Servers that are a part of the cluster. This overrides the value at the domain level.

  • Individual Managed Server level—setting it at the Managed Server level overrides the value set at the cluster or domain levels.

You may find it easiest to set the WebLogic Plug-in Enabled control at the domain level, so that any partitions for which you want to use Oracle Traffic Director are affected, regardless of which clusters or Managed Servers are involved. Or, if you know that the partition you want to use with Oracle Traffic Director will be targeted to only a specific cluster or Managed Server, you can choose to set the WebLogic Plug-in Enabled control at the cluster or Managed Server level.

Domain Level

Using the WLS Administration Console, to set the WebLogic Plug-in Enabled control at the domain level:

  1. In the Navigation pane, select the domain.

  2. Select the Configuration page, then Web Applications.

  3. Set the WebLogic Plug-in Enabled control.

  4. Save your changes.

Cluster Level

Using the WLS Administration Console, to set the WebLogic Plug-in Enabled control at the cluster level:

  1. In the Navigation pane, expand Environment.

  2. Select Clusters.

  3. Select the cluster you want to manage.

  4. Select the General page, then click Advanced.

  5. Set the WebLogic Plug-in Enabled control.

  6. Save your changes.

Managed Server Level

Using the WLS Administration Console, to set the WebLogic Plug-in Enabled control at the Managed Server level:

  1. In the Navigation pane, expand Environment.

  2. Select Servers.

  3. Select the servers you want to manage.

  4. Select the General page, then click Advanced.

  5. Set the WebLogic Plug-in Enabled control.

  6. Save your changes.

Creating Domain Partitions: Main Steps and Examples

The main steps to create a domain partition are as follows:

  1. Enter the partition name. The partition name must be unique within the domain.

  2. Select the security realm for this partition.

    The security realm can be unique to this partition, or shared by multiple partitions.

  3. Optionally, enter a name for the primary identity domain for the partition. Or, you can choose to not enter a name and accept the default.

  4. If you are using OTD for load balancing, select the OTD runtime configuration. You must have previously registered the OTD runtime.

  5. Select one or more existing virtual targets to be available for this domain partition to use. Multiple partitions cannot use the same virtual target. You can use a virtual target only with one partition or at the global (domain) level.

  6. Select one of the existing virtual targets to use as the default if a resource group in this partition does not explicitly identify one.

  7. Create the resource group. You can create the resource group in two ways:

    • Create a new resource group. When you finish creating the partition you must then edit this resource group as needed.

      Enter the resource group name. The resource group name must be unique within the partition.

    • Create the new resource group based on a resource group template. (For information on resource group templates, see Configuring Resource Group Templates.) The configuration is copied from the template to the new resource group.

      Enter the resource group name. The resource group name must be unique within the domain.

      Select the resource group template to use.

  8. Select the virtual targets that this resource group will use.

  9. If this is the first partition you have created in this domain, and the domain is running in production mode, restart the WebLogic Administration Server.

    This step is needed only for the first partition you create for a domain, and only when the domain is running in production mode.

  10. Start the partition. Partitions are created in a shutdown state and need to be started for the resources in them to be accessible.

  11. If you did not create the resource group from a resource group template, edit the resource group as needed.

    Proceed to Configuring Resource Groups for the main steps to follow.

To create a domain partition using Fusion Middleware Control, see "Create domain partitions" in the online help.

Creating Domain Partitions: WLST Example

The following example creates a domain partition PartitionMBean called pep from the DomainMBean. It then:

  1. Creates a domain partition.

  2. Creates a virtual target.

  3. Sets the host name and URI prefix for the virtual target.

  4. Adds the virtual target as an available target in the partition.

  5. Creates the resource group.

  6. Adds the virtual target to the resource group.

  7. Activates the changes.

  8. Starts the partition.

    Note:

    If this is the first partition created in production mode, you must restart the Administration Server before you can start the partition.
# Create Pep partition and ResourceGroup
edit()
startEdit()
wls:/base_domain/edit/ !> domain=getMBean('/')
wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep')
wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('TestVT')
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/ !> activate()
wls:/base_domain/edit/ !> startPartitionWait(peppart) 

Creating Domain Partitions: REST Example

For an example of creating domain partitions using REST, see "Creating Partitions" in Administering Oracle WebLogic Server with RESTful Management Services.

Managing Domain Partitions: Main Steps and Examples

You perform most of the configuration required for a partition when you configure the resource group or resource group overrides. The tasks include configuring JDBC system data sources, JMS servers and resources, foreign JNDI providers, and so forth. These tasks are described in Configuring Resource Groups and Configuring Resource Overrides, respectively.

This section focuses on the management tasks you perform on the domain partition itself, and not on the associated resource groups.

The main steps for managing domain partitions include the following:

  1. Select the domain partition you want to manage.

  2. Monitor the partition's performance and use.

  3. View and change the virtual targets available for this domain partition.

  4. View and change the resource groups configured in this partition.

  5. View and change any applications that are deployed to the partition. (Strictly speaking, you deploy an application to a resource group in a partition, not to the partition itself.)

  6. If you are using OTD for load balancing, view and change the OTD runtime configuration used with this partition.

  7. View and change any JDBC and JMS modules partition override configurations.

  8. View and change any partition Work Manager and Resource Manager configured for this partition.

  9. View and change the security realm and default target for this partition.

  10. Optionally, use the Notes attribute to specify additional information about this partition.

To manage a domain partition using Fusion Middleware Control, see "Configure domain partitions" in the online help.

Managing Domain Partitions: WLST Example

The following example:

  1. Creates a domain partition.

  2. Creates a virtual target.

  3. Sets the host name and URI prefix for the virtual target.

  4. Adds the virtual target as an available target in the partition.

  5. Creates the resource group.

  6. Adds the virtual target to the resource group.

  7. Activates the changes.

  8. Starts the partition.

    Note:

    If this is the first partition created in production mode, you must restart the Administration Server before you can start the partition.
  9. Deploys the application MySimpleEjb to the resource group.

# Create Pep partition and ResourceGroup
edit()
startEdit()
wls:/base_domain/edit/ !> domain=getMBean('/')
wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep')
wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('TestVT')
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/ !> activate()
 
wls:/base_domain/edit/ !> startPartitionWait(peppart)

wls:/base_domain/edit/ !> deploy(appName='MySimpleEjb', path='c:/webservices/MySimpleEjb.jar', partition='Pep', resourceGroup='TestRG',
deploymentOrder=10,securityModel='DDOnly')
:
Completed the deployment of Application with status completed
Current Status of your Deployment:
Deployment command type: deploy
Deployment State : completed
Deployment Message : no message

Managing Domain Partitions: REST Example

See the following REST examples:

Controlling Domain Partitions: Main Steps and Examples

You can reconfigure global and partition-specific resources without restarting the associated servers or clusters. Changes to one partition do not impact other partitions: you can create, start, stop, and delete partitions independently.

The main steps for controlling domain partitions are as follows:

  1. Select the partition you want to control. You do not need to select a partition in order to import a partition.

  2. Start the partition. All of the resource groups—and all of the applications deployed to those resource groups—are started.

  3. Shut down the partition. All of the resource groups—and all of the applications deployed to those resource groups—are shut down. Shutting down a resource group causes the applications and resources in that resource group to stop running and to be removed from memory.

    Shutting down the partition is the runtime equivalent of undeploying the application or resource, except that the configuration for the application or resource is not removed from the configuration file as it would be in a true undeploy operation. The configuration delivered to a Managed Server is also not removed.

  4. Suspend the partition. The suspend operation gracefully transitions the partition from the RUNNING to ADMIN states.

  5. Resume the partition. The resume operation gracefully transitions the partition from the ADMIN to RUNNING states.

  6. Import a partition. You can import a partition into another domain with only a minimal number of configuration changes being required. See Exporting and Importing Partitions.

  7. Export a partition. You can export a partition from one domain (the source domain) and import it into another domain (the target domain). See Exporting and Importing Partitions.

  8. Delete a partition. When you delete a partition, all of the resource groups in the partition are deleted and all of the applications deployed to the partition are undeployed.

    Note:

    You must shut down a partition before you can delete it.

To control a domain partition using Fusion Middleware Control, see "Control domain partitions" in the online help.

Actions That Require a Partition Restart

The following actions require a partition restart:

  • Any change to a non-dynamic attribute on a system resource in a resource group. For example, the URL of the JDBC database connection.

  • Any override that effects a non-dynamic attribute on a system resource. For example, the connection URL of the JMS foreign server.

  • Any non-targeting change to a virtual target that is in use by a running partition. For example, the URI prefix.

  • Any change to a resource deployment plan.

Controlling Domain Partitions: WLST Example

For examples of importing and exporting partitions with WLST, see Exporting and Importing Partitions.

The following example uses the WLST startPartitionWait() command to start a domain partition called pep from the root DomainMBean. For complete information on startPartitionWait(), see WLST Command Reference for WebLogic Server.

startPartitionWait() requires the partition to start. You can obtain the PartitionMBean from Domain.createPartition() or Domain.lookupPartition(), for example.

edit()
startEdit()
domain=getMBean('/')
startPartitionWait(domain.lookupPartition("Pep"))
[MBeanServerInvocationHandler]com.bea:Name=_5_START,Type=PartitionLifeCycleTaskRuntime,PartitionLifeCycleRuntime=Pep

Full Control with PartitionLifeCycleRuntimeMBean

startPartitionWait() is a convenience command. For full control of a partition life cycle, including shutting down a partition, use the PartitionLifeCycleRuntimeMBean. For a description of the PartitionLifeCycleRuntimeMBean MBean, see the MBean Reference for Oracle WebLogic Server.

The following example gracefully shuts down partition pep.

domainRuntime()
cd('DomainPartitionRuntimes')
cd ('pep')
cd('PartitionLifeCycleRuntime')
cd ('pep')
cmo.shutdown()
[MBeanServerInvocationHandler]com.bea:Name=_3_SHUTDOWN,Type=PartitionLifeCycleTaskRuntime,DomainPartitionRuntime=pep,PartitionLifeCycleRuntime=pep

The following example starts partition pep.

domainRuntime()
cd('DomainPartitionRuntimes')
cd ('pep')
cd('PartitionLifeCycleRuntime')
cd ('pep')
cmo.start()
[MBeanServerInvocationHandler]com.bea:Name=_4_START,Type=PartitionLifeCycleTaskRuntime,DomainPartitionRuntime=pep,PartitionLifeCycleRuntime=pep

The following example suspends partition pep.

domainRuntime()
cd('DomainPartitionRuntimes')
cd ('pep')
cd('PartitionLifeCycleRuntime')
cd ('pep')
cmo.suspend()
[[MBeanServerInvocationHandler]com.bea:Name=_5_SUSPEND,Type=PartitionLifeCycleTaskRuntime,DomainPartitionRuntime=pep,PartitionLifeCycleRuntime=pep

Controlling Domain Partitions: REST Example

For an example of controlling domain partitions using REST, see "Starting and Stopping Partitions" in Administering Oracle WebLogic Server with RESTful Management Services.