7 Configuring Domain Partitions
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:
-
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:
-
Use WLST to create the cluster or Managed Server.
-
Use the
applyJRF
command described in WLST Command Reference for Infrastructure Components to apply the JRF template to the Managed Servers.
-
-
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:
-
In the navigation pane, select the domain.
-
Select the Configuration > General page.
-
Expand the Advanced control.
-
Change the Lifecycle Management Services Availability control to
Local Admin Server
. -
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.
-
-
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.
-
If you have not already done so, create one or more virtual targets. See Configuring Virtual Targets for the steps to follow.
-
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.
-
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:
-
In the navigation pane, select the domain.
-
Select the Configuration page, then Web Applications.
-
Set the WebLogic Plug-in Enabled control.
-
Save your changes.
Cluster Level
Using the WebLogic Server Administration Console, to set the WebLogic Plug-in Enabled control at the cluster level:
-
In the navigation pane, expand Environment.
-
Select Clusters.
-
Select the cluster that you want to manage.
-
Select the General page, then click Advanced.
-
Set the WebLogic Plug-in Enabled control.
-
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:
-
In the navigation pane, expand Environment.
-
Select Servers.
-
Select the servers that you want to manage.
-
Select the General page, then click Advanced.
-
Set the WebLogic Plug-in Enabled control.
-
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.
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:
-
Creates a domain partition.
-
Creates a virtual target.
-
Sets the host name and URI prefix for the virtual target.
-
Adds the virtual target as an available target in the partition.
-
Creates the resource group.
-
Adds the virtual target to the resource group.
-
Activates the changes.
-
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
- Select the domain partition that you want to manage.
- Monitor the partition's performance and use.
- View and change the virtual targets available for this domain partition.
- View and change the resource groups configured in this partition.
- 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.)
- If you are using Oracle Traffic Director for load balancing, then view and change the Oracle Traffic Director runtime configuration used with this partition.
- View and change any JDBC and JMS modules partition override configurations.
- View and change any Partition Work Manager and Resource Consumption Manager configured for this partition.
- View and change the security realm and default target for this partition.
- 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:
-
Creates a domain partition.
-
Creates a virtual target.
-
Sets the host name and URI prefix for the virtual target.
-
Adds the virtual target as an available target in the partition.
-
Creates the resource group.
-
Adds the virtual target to the resource group.
-
Activates the changes.
-
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.
-
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.
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.