Example: Creating Cluster Partitions
About this task
- default
- node2
- node3
- node4
- node5
The example creates three partitions for the cluster:
- default (all portlets are enabled)
- partition2 (a specified group of portlets is disabled)
- partition3 (a specified group of portlets is disabled, but some are temporarily enabled)
To create partitions through editing configuration files
Procedure
-
At a command line prompt, type the
following command to move to the server’s bin directory:
cd Software AG_directory\MWS\bin -
To retrieve the
clusterPartitions.xml file from the
My webMethods Server database, type this command:
mws getconfig clusterPartitions.xml -
To retrieve the phaseProvider.xml
file from the
My webMethods Server database, type this command:
mws getconfig phaseProvider.xml -
To retrieve the
defaultPartitionPortlets.properties file from the
My webMethods Server database, type this command:
mws getconfig defaultPartitionPortlets.properties -
Open the downloaded
clusterPartitions.xml file in a text editor.
You can find all the downloaded files at this location:
Software AG_directory \MWS\server\serverName\config
-
Edit the clusterPartitions.xml file
using the syntax in
The Cluster Partition File
to add partition2 and partition3 to the cluster.
The modified clusterPartitions.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?> <ClusterPartitions> <Partition name="default" frontEndUrl="http://my.company.server:8585"> <Component name="default"> </Component> </Partition> <Partition name="partition2"> <Component name="node2"> </Component> <Component name="node3"> </Component> </Partition> <Partition name="partition3"> </Partition> </ClusterPartitions>Based on this file:
- The default partition contains the default node
- partition2 contains node2 and node3
- partition3 contains node4 and node5 (the last partition in the file contains all nodes not specifically assigned to other partitions)
-
Save and close the
clusterPartitions.xml file.
As a result, the default partition is established according to the The Default Partition Configuration, with all portlets enabled.
- Make a copy of phaseProvider.xml and name it partition2PhaseProvider.xml.
- Open the partition2PhaseProvider.xml file in a text editor.
-
In the
portletphase nested inside theCoreServicesphase, change defaultPartitionPortlets.properties to partition2Portlets.properties so the file looks like this:<PhaseInfo name="portlet" enabled="true" class="com.webmethods.portal.service.portlet.impl.PortletProvider" initFile="config:/partition2Portlets.properties" initFileComponentsEnabled="false"/>The phase provider now points to partition2Portlets.properties. Because initFileComponentsEnabled is set to false, portlets listed in that file will be disabled.
- Save and close the partition2Portlets.properties file.
- Make a copy of defaultPartitionPortlets.properties and name it partition2Portlets.properties.
-
Open the
partition2Portlets.properties file in a text editor and add a list of the
portlets that are to be disabled in partition2.
For example:
# These portlets will not be initialized. wm_task_chart___taskchart= wm_task_search___taskinboxsearchbar= wm_task_search___taskinboxsearchresults= wm_task_search___tlmsearchresults= wm_task_search___tlmsearchquery=In the user interface, these portlets have the following uses:
displays Task Chartstaskchart
displays Task List Managementtlmsearchquery- The remaining portlets display My Inbox
-
Save and close the
partition2Portlets.properties file.
As a result, certain portlets will be disabled on partition2 (node2 and node3).
Note: The procedure steps for partition3 demonstrate how to temporarily override a phase provider file. As a result, the steps are abbreviated because they largely duplicate the steps for partition2. - Make a copy of phaseProvider.xml and name it partition3PhaseProvider.xml.
- In partition3PhaseProvider.xml change, defaultPartitionPortlets.properties to partitionPortlets.properties.
-
Make a copy of
partition2Portlets.properties and name it partition3Portlets.properties.
As a result, partition3 is configured to disable the same portlets as partition2.
-
In partition3Portlets.properties,
prefix the
= at the
end of the last two portlets with a
+.
For example:
# These portlets will not be initialized. wm_task_chart___taskchart= wm_task_search___taskinboxsearchbar= wm_task_search___taskinboxsearchresults= wm_task_search___tlmsearchresults+= wm_task_search___tlmsearchquery+=Note: The choice of portlets is arbitrary for this example.As a result, partition3 (node4 and node5) has the same portlets disabled as partition2, but a subset of the portlets are enabled.
-
To deploy the new and revised files
to the
My webMethods Server database, type this command for each file:
mws putconfig fileName -
Delete all of these files from the
\serverName\config
directory.
If you do not delete the files, cluster will continue to use the local version of the configuration file.
-
Restart each node in the cluster
using this command:
mws - serverName restartChanges to configuration files are not applied until after a restart.