7 Configuring Domain Partitions

Oracle 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 Server domain that is dedicated to running application instances and related resources. You can create, configure, and manage domain partitions using Oracle Enterprise Manager Fusion Middleware Control (FMWC), WebLogic Scripting Tool (WLST), or Representational State Transfer (REST).

Note:

WebLogic Server Multitenant domain partitions, resource groups, resource group templates, virtual targets, and Resource Consumption Management are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.

This chapter includes the following sections:

Creating Domain Partitions

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, then create the domain that 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, then you must still create a new security realm as described in Configuring Security.

    Note:

    If you use Fusion Middleware Control or the Oracle WebLogic Server Administration Console, then 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 Oracle Java Required Files (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 WebLogic Server Administration Console or WLST.

    From the WebLogic Server 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 nondynamic change. Restart the Administration Server.

    From WLST:

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

    This is a nondynamic change. Restart the Administration Server.

  3. If you have not already done so, then 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, then create the resource group template first. See Configuring Resource Group Templates for the steps to follow.

  6. If you are using Oracle Traffic Director for load balancing, then register the Oracle Traffic Director runtime configuration. See Registering the Oracle Traffic Director Runtime for the steps to follow.

Oracle Traffic Director: WebLogic Server Plug-in Enabled Prerequisite

If you are using Oracle Traffic Director for load balancing, then you must set the WebLogic Plug-in Enabled control in the WebLogic Server 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 that you want to use with Oracle Traffic Director will be targeted to only a specific cluster or Managed Server, then you can choose to set the WebLogic Plug-in Enabled control at the cluster or Managed Server level.

Domain Level

Using the WebLogic Server 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 WebLogic Server 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 that 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 WebLogic Server 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 that 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

Creating domain partitions includes several tasks, such as specifying a security realm for the partition, selecting virtual targets, creating resource groups, and specifying targets for the resource groups.

The following information describes the main steps for creating domain partitions.

  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 not to enter a name and accept the default.
  4. If you are using Oracle Traffic Director for load balancing, select the Oracle Traffic Director runtime configuration. You must have previously registered the Oracle Traffic Director 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 with only 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 about 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 that you have created in this domain, and the domain is running in production mode, then restart the WebLogic Administration Server.

    This step is needed only for the first partition that 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, then 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 from the DomainMBean, called pep. It does the following:

  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, then 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

There are management tasks that you perform on the domain partition itself, and not on the associated resource groups. The tasks for configuring resource groups or resource group overrides are described in Configuring Resource Groups and Configuring Resource Overrides, respectively.
  1. Select the domain partition that 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 Oracle Traffic Director for load balancing, then view and change the Oracle Traffic Director 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 Consumption 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 example does the following:

  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, then 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:

  • For an example of creating partition-scoped data sources and a JMS system resource using REST, see Creating Partition-Scoped System Resources in Administering Oracle WebLogic Server with RESTful Management Services.

  • For an example of deploying partition-scoped applications using REST, see Deploying Partition-Scoped Applications in Administering Oracle WebLogic Server with RESTful Management Services.

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 affect other partitions: you can create, start, stop, and delete partitions independently.

  1. Select the partition that you want to control. You do not need to select a partition 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 nondynamic attribute on a system resource in a resource group. For example, the URL of the JDBC database connection.

  • Any override that affects a nondynamic attribute on a system resource. For example, the connection URL of the foreign JMS server.

  • Any nontargeting 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 more information about startPartitionWait(), see WLST Command Reference for WebLogic Server.

The startPartitionWait() command 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

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

The following example gracefully shuts down the 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 the 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 the 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.