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.

To enable a horizontal cluster for the Product Master you need to perform the tasks listed on the right side of this topic.
Note: The examples in this topic majorly use Linux® commands and show results on a Linux box. Differences might exist with the commands, output, or both if you are using AIX®, or even other types of Linux.

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.

The previous figure shows the following two profiles.
  1. Dmgr01 – with dmgr01 for deployment manager
  2. 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:
    catalog tcpip node ClustNod remote Hostname 50000
    catalog database pimdb at node ClustNod
    terminate
    Where,
    • 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.

  1. Configuring WebSphere Application Server on Host01.
  2. Create Deployment Manager (Dmgr01Host01) and a federated application server profile (AppSrv01Host01).
  3. Mount directories over the Network File System (NFS) to share installation directories.
  4. Configure IBM Installation Manager for the Product Master installation.
  5. Install the Product Master on the AppSrv01Host01 using the Installation Manager or through the installation scripts.
  6. Configure the WebSphere Application Server on Host02.
  7. Create the application server profile (AppSrv02Host02) on the Host02 while you are federating the profile to the Dmgr01Host01.
  8. Propagate the Product Master installation to the horizontal cluster topology.
  9. Configure the JVM Parameters and Product Master parameters for the cluster members.
  10. Add aliases to virtual host (MDMCE_VHOST01_HOST01).
  11. 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

To create the profile, proceed as follows:
  1. Open Profile Management Tool (PMT).
  2. 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
  3. In the WebSphere Customization Toolbox window, browse to the Profile Management Tool > Create.
  4. In the Environment Selection window, select Cell (deployment manager and a federated application server), and then click Next.
  5. In the Profile Creation Options window, select Advanced profile creation, and then click Next.
  6. In the Optional Application Deployment window, select Deploy the administrative console, and then click Next.
  7. 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
  8. 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
  9. 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.
  10. 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.
  11. 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
  12. 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
  13. 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:
  1. Create a directory for the Product Master files.
    /opt/IBM/MDMCE
  2. Give the folder full access rights by using the following command:
    chmod -R 777 MDMCE
  3. Check whether the NFS services are running by using the following command:
    /sbin/service nfs status
  4. If NFS services are not running, start them using the following command:
    /sbin/service nfs start
  5. 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>)...
  6. 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)
  7. Export the directory by using the following command:
    /usr/sbin/exportfs -a
  8. Create the Product Master $TOP directory to deploy Product Master.
  9. On Host02, create a directory by using the following command:
    mkdir -p /opt/IBM/MDMCE
  10. Give the folder full access rights by using the following command:
    chmod -R 777 MDMCE
  11. 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/MDMCE
    Example: mount Hostname1:/opt/IBM/MDMCE /opt/IBM/MDMCE
    Important: Ensure that the directory path of the shared directory on each box is identical.

Deploying the Product Master on the AppSrv01Host01

Prerequisites
  • 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.
To deploy the Product Master proceed as follows:
  1. 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.
  2. Deploy the Product Master full release files under a directory:
    /opt/IBM/MDMCE
    The $TOP is opt/IBM/MDMCE.
  3. Run the installation steps for the Product Master.
  4. 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.
  5. 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
  6. Verify that the deployment was successful by logging in to the installed Product Master.
  7. Confirm all the services are running by using the following command:
    $TOP/bin/go/rmi_status.sh
  8. Stop the instance by using the following command:
    $TOP/bin/go/abort_local.sh
  9. In the Product Master, import the following data models:
    $TOP/mdmui/env-export/dammodel/dammodel.zip
    $TOP/mdmui/env-export/mdmenv/mdm-env.zip
  10. Stop the IBM Product Master by using the following command:
    $TOP/bin/go/stop_local.sh
    Application URLs:
    • Admin UI - http://<hostname>:<port>/utils/enterLogin.jsp
    • Persona-based UI - http://<hostname>:<port>/mdm_ui

Configure the WebSphere Application Server on Host02

To create the profile, proceed as follows:
  1. Open Profile Management Tool (PMT).
  2. 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
  3. In the WebSphere Customization Toolbox window, browse to the Profile Management Tool > Create.
  4. In the Environment Selection window, select Custom profile, and then click Next.
  5. In the Profile Creation Options window, select Advanced profile creation, and then click Next.
  6. In the Profile Name and Location window, enter the following values:
    Field Value
    Profile name AppSrv02Host02
    Profile directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv02Host02
  7. In the Node and Host window, enter the following values:
    • Node name - Node02Host02
    • Hostname - Hostname2
  8. 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 ******
  9. Clear the Federate this node later and click Next.
  10. Use defaults in the next few windows, and review details in the Profile Creation Summary window, and click Create.
  11. 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

To span the existing Product Master application in to a WebSphere cluster, proceed as follows:
  1. 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
  2. Browse to System Administration > Console Preferences, select Synchronize changes with Nodes, and then click Save.
  3. Browse to Servers > Clusters > WebSphere application server clusters, and click New.
  4. In the Create a New Cluster page, specify the cluster name as MDMMDMCEHost01.
  5. Clear Configure HTTP session memory-to-memory replication and click Next.
  6. 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
  7. 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
  8. Clear Generate unique HTTP ports checkbox so that all the Product Master nodes use the same port to access the application.
  9. 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.
  10. Review the information on the Summary page, and click Finish.
To review the cluster that is created, click Servers > Clusters > Cluster Topology, and expand the MDMMDMCEHost01. Click Servers > Clusters > WebSphere Application Server clusters to see the new cluster on the right pane.
Important: You can obtain the HTTP ports of the cluster MDMMDMCEHost01 members (MDMCE_APPSERVER01_HOST01 and MDMCE_APPSERVER02_HOST02 application servers) by browsing to the Servers > WebSphere application servers > {MDMCE_APPSERVER_HOST} > Ports, and then search for the port.

Configuring JVM parameters and Product Master parameters for the cluster members

Proceed as follows:
  1. Browse to Servers > WebSphere Application servers > MDMCE_APPSERVER02_HOST02 > Server Types.
  2. Under the Server Infrastructure, browse to Java and Process Management > Process definition > Java Virtual Machine, and update the host name (Hostname2):
    -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
Note: You do not need to do these steps for the MDMCE_APPSERVER01_HOST01 as the generic JVM arguments are correctly configured for hostname1.

Create a Symbolic link

To create a Symbolic link for the Host02 and further nodes, if any, proceed as follows.

The Symbolic link (symlink or soft link) creates shortcuts or aliases for files or folders that are located in the file system.
  1. Go to $/opt/IBM/WebSphere/AppServer/profiles/<AppSrv02Host02>/installedApps/<your cell>/<ear name>/ccd.war directory.
  2. 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
  3. Restart IBM Product Master application.
  4. Clean the browser cache.

Configuring Product Master parameters for the cluster members

You need to add the following host names so that Product Master services are aware of the cluster and nodes:
  • 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>
The two nodes are sharing the configuration files. The service list needs to be different at both the nodes, so you need to provide two different configuration files for both the nodes. Proceed as follows:
  1. Create a folder that is named cluster under the $TOP directory.
  2. Create folders mdmapp1 and mdmapp2 in the cluster folder.
  3. Go to $TOP/bin/conf directory on Node 1 and run the following command:
    cp -R * . ./. ./cluster/mdmapp1
    cp -R * . ./. ./cluster/mdmapp2 
    
  4. On Host01, add this line to the .bashrc file:
    export CCD_CONFIG_DIR=/opt/IBM/MDMCE/cluster/mdmapp1
  5. On Host02 add this line to the .bashrc file:
    export CCD_CONFIG_DIR=/opt/IBM/MDMCE/cluster/mdmapp2
  6. Enter bash on both the Host01 and Host02. Each host then has its own configuration files.
  7. 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
  8. 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
  9. On both Host01 and Host02 run the following script:
    $TOP/setup.sh
  10. Rerun $TOP/bin/configureEnv.ini and then run the following script:
    $TOP/bin/compat.sh
  11. Add the host aliases to the virtual host. In the IBM WebSphere administrative console, browse to Environment > Virtual Hosts > MDMCE_VHOST01_HOST01 > Host Aliases, and add the HTTP ports of the two cluster members.
Starting the Appservers
  1. Browse to the $TOP/bin/go on Host01 and run the ./start_local.sh script.
  2. Browse to the $TOP/bin/go on Host02 and run the ./start_local.sh script.
  3. 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.

Enabling SSL for the cluster

  1. Browse to Servers > Server Types > WebSphere Application Server.
  2. In the Preferences, click MDMCE_APPSERVER01_HOST01.
  3. In the Container Settings, expand Web Container Settings, click the Web container transport chains and select WCInboundDefaultSecure.
  4. Check the Enable checkbox, then click Apply > Save.
  5. Repeat steps 3 and 4 for MDMCE_APPSERVER02_HOST02.
  6. Click Environment > Virtual Hosts > MDMCE_VHOST01_HOST01 > Host Aliases > New.
  7. Modify the port to have the same value as displayed in step 4, and click Apply > Save.
  8. Stop Product Master services.
  9. Run the updateRtProperties.sh script at the $TOP/mdmui/bin folder.
  10. Start Product Master services.
  11. 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:

  1. Browse to Servers > Server Types > WebSphere Application Server.
  2. In the Preferences, click MDMCE_APPSERVER01_HOST01.
  3. In the Container Settings, expand Session management, click the General properties and select Enable Cookies.
  4. Check the Use the context root checkbox, then click Apply > Save.
  5. Browse to Servers > Server Types > WebSphere Application Server.
  6. In the Preferences, click MDMCE_APPSERVER01_HOST01.
  7. In the Container Settings, expand Web Container Settings > Web Container > Custom properties > New.
  8. Add HttpSessionCloneId property with the following values:
    Field Value
    Name HttpSessionCloneId
    Value MDMCE_APPSERVER01_HOST01
    Description HttpSessionCloneId
  9. Repeat steps 2-8 for the MDMCE_APPSERVER02_HOST02.
  10. Browse to Servers > Server Types > Web Servers, select web server and click Generate Plug-in.
  11. Now, restart the application and web servers to verify the application for the sticky session.