Feature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6

Clustering WebSphere Commerce search

By completing this task, you can set up WebSphere Commerce search in a clustered environment. The WebSphere Commerce search cluster allows you to manage multiple WebSphere Commerce search instances from one WebSphere Application Server console.

Before you begin

If you plan on replicating WebSphere Commerce search:
  1. Ensure that you consider the following replication recommendations:
    • Setup one master search index server to hold the master index, which is then replicated to all the search servers that take search traffic. That is, there typically exists a dedicated index-building machine, which is known as the master, to build the index. The index is then replicated to other search engine machines, which are known as targets. The runtime search performance is not affected during the index-building.
    • Set up the master search index server and subordinate search index server (separately) on the same operating system. This set up ensures easier file copy operations between servers.
  2. Ensure that the following tasks are completed on your master server:
  3. Ensure that the following tasks are completed on your subordinate server that you want to cluster:
    • Deploying the search server
      Note: You can skip setting up the search index structure (setupSearchIndex utility), as you can simply copy the Solr home directory from the master search server. The default Solr home is in the following location:
      • WebSphere Commerce DeveloperWCDE_installdir/search/solr/home
      • SolarisLinuxAIXWindowsWC_installdir/instances/instance_name/search/solr/home
      • For IBM i OS operating systemWC_instance_root/instances/instance_name/search/solr/home

Procedure

  1. Install the WebSphere Application Server Network Deployment product by using the media that are supplied with WebSphere Commerce. This node now hosts the deployment manager. Although you can install other application servers on the same node as the deployment manager, it is not done unless you have a node with the capacity to host both products.
  2. Create a non-root WebSphere Application Server Deployment Manager profile on the WebSphere Application Server Network Deployment machine. For more information about creating a WebSphere Application Server Deployment Manager profile, see:
  3. On the WebSphere Application Server Network Deployment machine, start the deployment manager profile.
  4. SolarisLinuxAIXWindows To prevent problems in the next step, update the addNode script by completing the following instructions:
    1. For IBM i OS operating systemSolarisLinuxAIX Log on to the WebSphere Commerce search node as root.
    2. Open the following file in a text editor:
      • For IBM i OS operating systemSolarisLinuxAIXWAS_installdir/bin/addNode.sh
      • WindowsWAS_installdir/bin/addNode.bat
    3. In the text file, find the following line of text:
      • For IBM i OS operating systemSolarisLinuxAIX
        
        "$JAVA_HOME"/bin/java \
        
      • Windows
        
        "%JAVA_HOME%\bin\java" -Dcmd.properties.file=%TMPJAVAPROPFILE% %WAS_DEBUG% %WAS_TRACE% 
        %CONSOLE_ENCODING% "%CLIENTSOAP%" "%JAASSOAP%" "%CLIENTSAS%" 
        "-classpath" "%WAS_CLASSPATH%" "-Dws.ext.dirs=%WAS_EXT_DIRS%" "-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager" 
        "-Djava.util.logging.configureByServer=true" %USER_INSTALL_PROP% "-Dwas.install.root=%WAS_HOME%" 
        "-DWAS_HOME=%WAS_HOME%" "com.ibm.ws.bootstrap.WSLauncher" 
        "com.ibm.ws.management.tools.NodeFederationUtility" "%CONFIG_ROOT%" "%WAS_CELL%" "%WAS_NODE%" %*
        
    4. Complete one of the following steps:
      • For IBM i OS operating systemSolarisLinuxAIXInsert the following below the "$JAVA_HOME"/bin/java \ line of text:
        
        -Xms256m -Xmxmax_allowed \
        
        For example, one of the following lines can be inserted:
        • -Xms256m -Xmx1024m \ indicates that the max_allowed is set to 1024 m
        • -Xms256m -Xmx12288k \ indicates that the max_allowed is set to 12288 k
      • WindowsInsert the following between the "-DWAS_HOME=%WAS_HOME%" and "com.ibm.ws.bootstrap.WSLauncher" entries:
        
        -Xms256m -Xmxmax_allowed
        
        For example, one of the following lines can be inserted:
        • -Xms256m -Xmx1024m indicates that the max_allowed is set to 1024 m
        • -Xms256m -Xmx12288k indicates that the max_allowed is set to 12288 k
      The max_allowed parameter represents the Java maximum heap size value that is allowed by your operating system. This value must a multiple of 1024. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes.
      Note: Ensure that your environment supports your max_allowed value. For example, larger values might require 64-bit hardware and a 64-bit JVM.
    5. Save the changes and exit the text editor.
    6. Log on to the WebSphere Application Server Network Deployment deployment manager administrative console.
    7. Expand System Administration > Deployment Manager > Java and Process Management > Process Definition > Java Virtual Machine.
    8. Change the Maximum Heap Size value to the maximum value supported by your operating system.
      For example, 1024 MB. You can reduce this number once you complete the federation process.
    9. Restart the Deployment Manager.
  5. Before you federate the WebSphere Commerce search application server node into the deployment manager cell, set the SOAP connection timeout to 0. To adjust the SOAP timeout settings, complete the following steps on the WebSphere Commerce Search node:
    1. Open the following file in a text editor:
      • Solr_profiledir/properties/soap.client.props
    2. Search for the com.ibm.SOAP.requestTimeout entry. Record the existing value, and change the value to 0.
      For example, com.ibm.SOAP.requestTimeout=0.
    3. Save the file, and exit.
  6. Ensure that the system clocks on your WebSphere Commerce search node and your WebSphere Application Server Network Deployment node are synchronized within 5 minutes of each other and are set to the same time zone. If the clocks are not synchronized, the federation fails.
  7. On the WebSphere Commerce search node:
    1. SolarisLinuxAIX Log on as the non-root user.
    2. For IBM i OS operating system Log on with a user profile that has *SECOFR authority.
    3. Federate the WebSphere Commerce search application server into the deployment manager cell by issuing the following command:
      • For IBM i OS operating systemSolarisLinuxAIXSolr_profiledir/bin/addNode.sh deployment_manager_host_name [SOAP_port] -includeapps
      • WindowsSolr_profiledir/bin/addNode.bat deployment_manager_host_name [SOAP_port] -includeapps
      Note: Your WebSphere Commerce search instance is stopped automatically during the federation process. The command is shown on multiple lines for display purposes only, enter the command on one line.
      Solr_profiledir
      This directory is created for the WebSphere Application Server profile that is used by a WebSphere Commerce search instance.
      deployment_manager_host_name
      This name is the fully qualified host name of the deployment manager node.
      SOAP_port
      Optional: This port is the SOAP port on which the deployment manager listens. This port number is defined when you create the deployment manager profile. The default deployment manager port is 8879.
      Specifying the SOAP port is useful when you have multiple Dmgr installed. Otherwise, you do not have to provide this information.
      includeapps
      Optional: When you federate a WebSphere Commerce search profile that contains a WebSphere Commerce search instance, you must include this parameter. This parameter ensures that the WebSphere Commerce search application (EAR) file is transferred to the new configuration.
  8. SolarisLinuxAIX After you federate a WebSphere Application Server profile, the node agent must be managed by the non-root user.
  9. You must reset the SOAP connection timeout to the original value. To adjust the setting for the SOAP timeout, complete the following steps on the WebSphere Commerce search node:
    1. Open the following file in a text editor:
      • Solr_profiledir/properties/soap.client.props
    2. Search for the com.ibm.SOAP.requestTimeout entry. Reset the entry to the original value. For more information, see WebSphere Application Server Best Practices.
    3. Save the file, and exit.
  10. Create the cell-level documents, such as virtual hosts, on your WebSphere Commerce search node:
    1. Go to the following directory: WAS_installdir/bin
    2. Run the deployment script:
      • For IBM i OS operating systemSolarisLinuxAIXws_ant.sh -buildfile working_dir/search/deploy/deploySearch.xml -DdbUserPassword=dbuserpwd [-DsolrHome=solrhome] PrepareWASEnvironment ConfigWebserver GeneratePlugin Feature Pack 3[-DSolrWASAdminUser=solr_wasadminuser -DSolrWASAdminPassword=solr_wasadminpassword]
      • Windowsws_ant.bat -buildfile working_dir/search/deploy/deploySearch.xml -DdbUserPassword=dbuserpwd [-DsolrHome=solrhome] PrepareWASEnvironment ConfigWebserver GeneratePlugin Feature Pack 3[-DSolrWASAdminUser=solr_wasadminuser -DSolrWASAdminPassword=solr_wasadminpassword]
      Where:
      solrhome
      The location of the Solr home directory path that contains the index data of Solr. The value must be an absolute path.
      The default value is:
      • WebSphere Commerce DeveloperWCDE_installdir/search/solr/home
      • SolarisLinuxAIXWindowsWC_installdir/instances/instance_name/search/solr/home
      • For IBM i OS operating systemWC_instance_root/instances/instance_name/search/solr/home
      Introduced in Feature Pack 3solr_wasadminuser
      Introduced in Feature Pack 3The WebSphere Application Server administrator user ID for the Solr cell.
      Introduced in Feature Pack 3solr_wasadminpassword
      Introduced in Feature Pack 3The WebSphere Application Server administrator password for the Solr cell.
      Feature Pack 3When:
      • A previous version of WebSphere Commerce search is enabled from an earlier Feature Pack version (for example, Feature Pack 2), and
      • WebSphere Application Server administrative security is enabled on the search server and Solr cell
      Note:
      • If you enabled security before you federated your WebSphere Commerce search application, you must enable security again.
  11. Restart the Deployment Manager and the WebSphere Commerce search server.
  12. Regenerate the Web server plug-in for your Web server:
    1. Log on the WebSphere Application Server Network Deployment Administration Console server.
    2. Expand Servers > WebServers.
    3. Select solrWebserver and click Generate Plugin to generate the plugin-cfg.xml file for the Web server.
  13. Configure the Web server for the Solr application.

    The Web server is created when you deploy the WebSphere Commerce search server, and the Solr Web server is automatically added to dmgr after federation.

    To configure the Web server for the Solr application, complete the following steps:

    1. Copy the updated plugin-cfg.xml file to your WebSphere Commerce search cluster machine.
    2. Update the Web server configuration:
      1. For IBM HTTP Server, open the configuration file httpd.conf
      2. Point the plug-in file to the location where you copied the updated file.
  14. Add additional nodes to your search cluster, as necessary.
    Adding more nodes to your topology is required when you configure horizontal clustering.
  15. Cluster the WebSphere Commerce search application server. For more information, see create a new cluster.
  16. Manually copy the Solr home directory from the first WebSphere Commerce search application server to all clustered servers.
    The default Solr home is in the following location:
    • working_dir/search/instance_name/search/solr/home
    • WebSphere Commerce DeveloperWCDE_installdir/search/solr/home