Enabling horizontal cluster for the IBM Product Master
Horizontal clustering involves adding more computers to a cluster. You can spread the cluster across several computers horizontally.
With horizontal clustering, multiple application servers are deployed on the different physical computers, which provide an easy and convenient way of scaling beyond the hardware limitations of a single computer. If a computer fails, the remaining computers are unaffected and the application can still be served by another cluster member. Horizontal clustering also increases the scalability of the system by distributing the processing across several CPUs. Typically, each physical computer comprises one node, so generally, you can say that each computer is a cluster node.
Setting up WebSphere Application Server
Before you can install IBM® Product Master, you must set up your WebSphere® Application Server.
If you plan to use the clustering and workload management features of WebSphere Application Server, you must
install the deployment manager, as shown in the following figure.
- Dmgr01 – with dmgr01 for deployment manager
- AppSrv01 – with server1 for a managed node, for example
mdmpimNode01
.
Setting up a horizontal cluster on the two boxes running Product Master over the IBM HTTP Server
Prerequisites
- IBM
WebSphere Application Server 9
Network Deployment on each box. Run the following command to confirm the
installed
version:
WASinstall_directory}/bin/versionInfo.sh
- SDK 1.8 (depending on the version of IBM WebSphere Application Server used) is enabled on all profiles.
- You have installed a database server.
- You must also create a database specifically for the Product Master. As a DB admin, run
the following command:
create_pimdb.sh
- Install a database client on both the cluster and the workstation.
- Disable the firewalls. Run the following command to disable the
firewall:
Red Hat
service firewalld stop
CentOS
systemctl stop firewalld
- The database that is used must be cataloged on each member of the cluster.
As a DB admin, run the following command on each
box:
Where,catalog tcpip node ClustNod remote Hostname 50000 catalog database pimdb at node ClustNod terminate
- ClustNod is an arbitrary name for the database node (8 characters or less).
- The database port is 50000.
- The database for the Product Master is
pimdb
.
Deploying the Product Master in the clustered environment
Deploy the Product Master on an application server and then convert application server into a cluster.
- Configuring WebSphere Application Server on Host01.
- Create Deployment Manager (Dmgr01Host01) and a federated application server profile (AppSrv01Host01).
- Mount directories over the Network File System (NFS) to share installation directories.
- Configure IBM Installation Manager for the Product Master installation.
- Install the Product Master on the
AppSrv01Host01
using the Installation Manager or through the installation scripts. - Configure the WebSphere Application Server on Host02.
- Create the application server profile (AppSrv02Host02) on the Host02 while you are federating the profile to the Dmgr01Host01.
- Propagate the Product Master installation to the horizontal cluster topology.
- Configure the JVM Parameters and Product Master parameters for the cluster members.
- Add aliases to virtual host (MDMCE_VHOST01_HOST01).
- Install a single HTTP Server and configure the server to work as a front end
to the cluster.Note: You can perform all the tasks as a root user, at least initially. File access and ownership can be changed later, if wanted.
Create Deployment Manager and a federated application server profile
- Open Profile Management Tool (PMT).
- Open the WebSphere Customization
Toolbox by using the following command in the command prompt or from the
menu that you are accessing the server with the VNC client
UI:{Websphere Deployment Directory}/bin/ProfileManagement/eclipse/pmt.sh
- In the WebSphere Customization Toolbox window, browse to the .
- In the Environment Selection window, select Cell (deployment manager and a federated application server), and then click Next.
- In the Profile Creation Options window, select Advanced profile creation, and then click Next.
- In the Optional Application Deployment window, select Deploy the administrative console, and then click Next.
- In the Optional Application Deployment window, enter
the names and home directories for the profiles to be created, for example:
- Deployment manager profile - Dmgr01Host01
- Application server profile - AppSrv01Host01
- Profile directory - /opt/IBM/WebSphere/AppServer
- In the Node, Host, and Cell Names window, enter the
following values:
- Deployment manager node name - CellManager01Host01
- Application server node name - Node01Host01
- Hostname - Hostname1
- Cell name - Cell01Host01
- In the Administrative Security window, enable administrative security by providing a username and a password. Use defaults in the next steps, review details in the Profile Creation Summary window, and click Create.
- After a successful profile creation, click Finish on the Profile Creation Complete window, and clear the Launch the first steps console checkbox. The WebSphere Customization Toolbox window shows profiles that are created.
- From the command prompt, use the following commands to start
Dmgr01Host01 manager and
AppSrv01Host01 node agent:
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01Host01/bin/startManager.sh/ opt/IBM/WebSphere/AppServer/profiles/AppSrv01Host01/bin/startNode.sh
- Use the following command to confirm that the SDK 1.7, 1.7.1 or 1.8 is
enabled on these
profiles:
/opt/IBM/WebSphere/AppServer/bin/managesdk.sh -listEnabledProfileAll
- Run the following command to enable the appropriate SDK on the profile if
needed:
/opt/IBM/WebSphere/AppServer/bin/managesdk.sh -enableProfile -profileName <profileName> -sdkname 8.0_64
Mount directories over the Network File System (NFS)
To set up Product Master directory over the NFS:- Create a directory for the Product Master files.
/opt/IBM/MDMCE
- Give the folder full access rights by using the following command:
chmod -R 777 MDMCE
- Check whether the NFS services are running by using the following
command:
/sbin/service nfs status
- If NFS services are not running, start them using the following command:
/sbin/service nfs start
- Specify which part of the file system is to be accessed, or shared, by the
nodes. Edit or create the file /etc/exports to export
directories and set options for access by remote systems through NFS. The format
is
<export dir> <host1>(<options>)<host2>(<options>)...
- To export the directory so that the directory is available for mounting on the
other servers, add the following line into the exports
file:
/opt/IBM/MDMCE *(rw,sync,no_root_squash)
- Export the directory by using the following command:
/usr/sbin/exportfs -a
- Create the Product Master $TOP directory to deploy Product Master.
- On Host02, create a directory by using the following
command:
mkdir -p /opt/IBM/MDMCE
- Give the folder full access rights by using the following
command:
chmod -R 777 MDMCE
- Mount the $TOP folder on host 02, log in to host 02 and use
the following command to mount host 01 directories to host
02:mount hostname:/opt/IBM/MDMCE /opt/IBM/MDMCEExample: mount Hostname1:/opt/IBM/MDMCE /opt/IBM/MDMCEImportant: Ensure that the directory path of the shared directory on each box is identical.
Deploying the Product Master on the AppSrv01Host01
- The server Host01 has the latest version of IBM Installation Manager.
- The database is cataloged on each workstation in the cluster.
- The database is created for Product Master and the DB admin
started the database by using the following command:
db2start
- Firewalls are deactivated.
- Export the required environment variables by inserting the following lines
in the ~/.bashrc, ~./bash_profile or
~/.profile depending on the default shell on both
the Host1 and
Host2.
# User specific environment and startup programs source /home/db2inst1/sqllib/db2profile #--------------------------------------------# # PIM configuration # #--------------------------------------------# PATH=$PATH:$HOME/bin export TOP=/opt/IBM/MDMCE export PERL5LIB=$TOP/bin/perllib export JAVA_HOME=/opt/IBM/WebSphere/AppServer/java/8.0 export COMPAT=$TOP/bin/compat.sh export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:. export MQ_INSTALL_DIR=/opt/mqm export LANG=en_US export JAVAC=`perl $HOME/.config.pl --option=javac 2>/dev/null` export ANT_HOME=/opt/IBM/WebSphere/AppServer/deploytool/itp/plugins/org.eclipse.wst.command.env_1.0.409.v201004211805.jar export ANT_OPTS=-Xmx1024m export ANT_ARGS=-noclasspath export MAVEN_USERNAME="username@xx.ibm.com" export MAVEN_PASSWORD="xxxxxxxxx" export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/providerutil.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/ldap.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/jta.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/jndi.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/jms.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/connector.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/fscontext.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/com.ibm.mqjms.jar; export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/com.ibm.mq.jar; export PLUGIN_HOME=/opt/IBM/WebSphere/Plugins PATH=$PATH:$ANT_HOME/bin export WAS_HOME=/opt/IBM/WebSphere/AppServer
Note: Ensure that the db2profile, JAVA_HOME, and TOP values are from your setup. - Deploy the Product Master full
release files under a directory:
The $TOP is opt/IBM/MDMCE./opt/IBM/MDMCE
- Run the installation steps for the Product Master.
- In the env_setting.ini file that is located in the
/opt/IBM/MDMCE/bin/conf directory, check the following:
- Edit the
[cache]
section as follows:# multicast ip addr for MDMPIM cache. Must be unique on the LAN multicast_addr=239.0.10.1 # TTL for multicast packets. Set to 0 for single-machine installations or 1 for clusters multicast_ttl=1
- Edit the
[appserver.websphere]
section as follows:cell_name=Cell01Host01 node_name=Node01Host01 # set security to true if administrative security is enabled. admin_security=true
- Edit the
[appserver.appsvr]
section as follows:port=7507 appserver_name=MDMCE_APPSERVER01_HOST01 vhost_name=MDMCE_VHOST01_HOST01
- Check the path to the common_properties and java_home properties.
- Edit the
- Run the following commands:
$TOP/setup.sh –ov configure.sh –ov compat.sh cd bin/websphere create_appserver.sh create_vhost.sh install_war.sh start_local.sh $TOP/mdmui/bin/installAll.sh
- Verify that the deployment was successful by logging in to the installed Product Master.
- Confirm all the services are running by using the following command:
$TOP/bin/go/rmi_status.sh
- Stop the instance by using the following command:
$TOP/bin/go/abort_local.sh
- In the Product Master, import the
following data
models:
$TOP/mdmui/env-export/dammodel/dammodel.zip $TOP/mdmui/env-export/mdmenv/mdm-env.zip
- Stop the IBM Product Master by using the
following command:
Application URLs:$TOP/bin/go/stop_local.sh
- Admin UI - http://<hostname>:<port>/utils/enterLogin.jsp
- Persona-based UI - http://<hostname>:<port>/mdm_ui
Configure the WebSphere Application Server on Host02
- Open Profile Management Tool (PMT).
- Open the WebSphere Customization
Toolbox by using the following command in the command prompt or from the
menu that you are accessing the server with the VNC client
UI:
{Websphere Deployment Directory}/bin/ProfileManagement/eclipse64/pmt.sh
- In the WebSphere Customization Toolbox window, browse to the .
- In the Environment Selection window, select Custom profile, and then click Next.
- In the Profile Creation Options window, select Advanced profile creation, and then click Next.
- In the Profile Name and Location window, enter the
following values:
Field Value Profile name AppSrv02Host02 Profile directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv02Host02 - In the Node and Host window, enter the following values:
- Node name - Node02Host02
- Hostname - Hostname2
- Specify the details of the existing Deployment manager for federation, enter
the following values:
Field Value Deployment manager hostname Hostname2 Deployment manager SOAP port 8879 Username configadmin Password ****** - Clear the Federate this node later and click Next.
- Use defaults in the next few windows, and review details in the Profile Creation Summary window, and click Create.
- Start the AppSrv02Host02 node agent by using the
following command:
/opt/IBM/WebSphere/AppServer/profiles/AppSrv02Host02/bin/startNode.sh
Creating a cluster of Horizontal topology
- Log in to the WebSphere
Application Server Integrated Solutions Console (admin console) on
Host01. The admin console is for Dmgr01Host01
(manager profile).
- URL - https://<hostname>:<port>/ibm/console/logon.jsp
- Credentials - configadmin/passw0rd
- Browse to Synchronize changes with Nodes, and then click Save. , select
- Browse to New. , and click
- In the Create a New Cluster page, specify the cluster name as MDMMDMCEHost01.
- Clear Configure HTTP session memory-to-memory replication and click Next.
- In the Create First Cluster Member page, enter the
following:
Field Value Member name MDMCE_APPSERVER01_HOST01 Select node Node01Host01(ND 9.0.0.0) Weight 2 - In the Create additional cluster members page, enter
the following, and click Add Member.
Field Value Member name MDMCE_APPSERVER01_HOST02 Select node Node01Host02(ND 9.0.0.0) Weight 2 - Clear Generate unique HTTP ports checkbox so that all the Product Master nodes use the same port to access the application.
- Select the following check boxes, and click Next:
- Select how the server resources are promoted in the cluster.
- Create the member by converting an existing application server.
- Review the information on the Summary page, and click Finish.
Configuring JVM parameters and Product Master parameters for the cluster members
- Browse to .
- Under the Server Infrastructure, browse to
-Dsvc_name=appsvr_Hostname2 -DTOP=/opt/IBM/MDMCE -DCCD_ETC_DIR=/opt/IBM/MDMCE/etc -Dsvc_etc_dir=/opt/IBM/MDMCE/etc/default -Dtrigo.memflags=-Xmx1024m_-Xms256m -Djava.security.policy=/opt/IBM/MDMCE/etc/default/java.policy -Dexit_if_config_file_not_found=false -DenableJava2Security=true -Dsysout.dir=/opt/IBM/MDMCE/logs/appsvr_Hostname2
, and update the host name
(Hostname2):
Create a Symbolic link
To create a Symbolic link for the Host02 and further nodes, if any, proceed as follows.
- Go to $/opt/IBM/WebSphere/AppServer/profiles/<AppSrv02Host02>/installedApps/<your cell>/<ear name>/ccd.war directory.
- Create the symbolic links by using the following
commands.
ln -s $TOP/public_html/user user ln -s $TOP/public_html/suppliers suppliers ln -s $TOP/etc/default/csrf csrf
- Restart IBM Product Master application.
- Clean the browser cache.
Configuring Product Master parameters for the cluster members
- Edit the admin_properties.xml file that is at the
$TOP/etc/default/ folder to add the two hostnames,
as follows:
<admin> <cluster> <host name="Hostname1"/> <host name="Hostname2"/> </cluster> </admin>
- Create a folder that is named cluster under the $TOP directory.
- Create folders mdmapp1 and mdmapp2 in the cluster folder.
- Go to $TOP/bin/conf directory on Node 1 and run the
following command:
cp -R * . ./. ./cluster/mdmapp1 cp -R * . ./. ./cluster/mdmapp2
- On Host01, add this line to the
.bashrc file:
export CCD_CONFIG_DIR=/opt/IBM/MDMCE/cluster/mdmapp1
- On Host02 add this line to the
.bashrc file:
export CCD_CONFIG_DIR=/opt/IBM/MDMCE/cluster/mdmapp2
- Enter bash on both the Host01 and Host02. Each host then has its own configuration files.
- On Host02, add the following to the
env_settings.ini file at the
$CCD_CONFIG_DIR/ folder to configure the scheduler:
- Edit the [appserver.websphere] section as
follows:
admin_security=true application_server_profile=AppSrv02Host02 cell_name=Cell01Host01 node_name=Node02Host02
- Edit the [services] section as
follows:
admin=admin eventprocessor=eventprocessor queuemanager=queuemanager scheduler=scheduler workflowengine=workflowengine appsvr=appsvr
- Edit the [appserver.websphere] section as
follows:
- On Host01, add the following to the
env_settings.ini file at the
$CCD_CONFIG_DIR/ folder to remove the workflow service:
- Edit the [services] section as
follows:
admin=admin eventprocessor=eventprocessor queuemanager=queuemanager scheduler=scheduler workflowengine=workflowengine appsvr=appsvr
- Edit the [services] section as
follows:
- On both Host01 and Host02 run the
following script:
$TOP/setup.sh
- Rerun $TOP/bin/configureEnv.ini and then run the
following script:
$TOP/bin/compat.sh
- Add the host aliases to the virtual host. In the IBM WebSphere administrative console, browse to , and add the HTTP ports of the two cluster members.
- Browse to the $TOP/bin/go on Host01 and run the ./start_local.sh script.
- Browse to the $TOP/bin/go on Host02 and run the ./start_local.sh script.
- Check the services that are running on both the workstations by running the
./rmi_status.sh script.Important:
- After the cluster is created, do not run the following scripts
that else you would need to delete and re-create the cluster:
- create_vhost.sh
- create_appsvr.sh
- install_war.sh
- installAll.sh
- Since the Admin UI and Persona-based UI are deployed on the same Appserver, the application URL has port of the Admin UI , for example, "7507". Thus, in the env_settings.ini file when the value of the cluster enable=yes, the was-server port is ignored.
Note: You need to re-create cluster if you update the instance or apply any fix pack. - After the cluster is created, do not run the following scripts
that else you would need to delete and re-create the cluster:
Enabling SSL for the cluster
- Browse to .
- In the Preferences, click MDMCE_APPSERVER01_HOST01.
- In the Container Settings, expand Web Container Settings, click the Web container transport chains and select WCInboundDefaultSecure.
- Check the Enable checkbox, then click .
- Repeat steps 3 and 4 for MDMCE_APPSERVER02_HOST02.
- Click .
- Modify the port to have the same value as displayed in step 4, and click .
- Stop Product Master services.
- Run the updateRtProperties.sh script at the $TOP/mdmui/bin folder.
- Start Product Master services.
- Repeat steps 9-11 for the HOST02.
Enabling sticky sessions
The sticky session feature enables the load balancer to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.
Proceed as follows to enable sticky sessions for the IBM HTTP Server:
- Browse to .
- In the Preferences, click MDMCE_APPSERVER01_HOST01.
- In the Container Settings, expand Session management, click the General properties and select Enable Cookies.
- Check the Use the context root checkbox, then click .
- Browse to .
- In the Preferences, click MDMCE_APPSERVER01_HOST01.
- In the Container Settings, expand .
- Add HttpSessionCloneId property with the following
values:
Field Value Name HttpSessionCloneId Value MDMCE_APPSERVER01_HOST01 Description HttpSessionCloneId - Repeat steps 2-8 for the MDMCE_APPSERVER02_HOST02.
- Browse to web server and click Generate Plug-in. , select
- Now, restart the application and web servers to verify the application for the sticky session.