CQ - Setting up clustering in CQ 5.6

Pre requisite

  1. Copy your cq instance to another directory to have two instances of cq running in order to setup cluster on two instances. One of the instance will work as Master instance and another one will work as slave.
  2. Change port number of another instance to 4503 assuming first instance is running on port 4502.

Steps to set up clustering in CQ 5.6

  1. Goto <cq slave installation directory>\crx-quickstart\repository directory.
  2. Delete cluster_node.id file present inside repository directory.
  3. Open <cq master installation directory>\crx-quickstart\repository\cluster_node.id and copy the value.
  4. Open  <cq slave installation directory>\crx-quickstart\repository\cluster.properties.
  5. Put value of clusterid copied from master instance to members key. Let's say "22410d70-250e-494b-b711-6c264d5a57bc" was cluster id of master node, then put this value under members key as shown below. 
          #Cluster properties
              #Tue Jul 16 14:30:38 IST 2013
                members=22410d70-250e-494b-b711-6c264d5a57bc

           6. Delete cluster_id from cluster.properties
           7. Restart slave instance. You should see something like "20.08.2013 21:35:55.447 *INFO* [127.0.0.1          [1377014754739] POST /libs/granite/cluster/content/admin/cluster/ HTTP/1.1]                         com.day.crx.core.cluster.ClusterController Node a496b210-8417-48f7-9420-cfd66ee72a1a 
      started as: slave, connected to address: localhost/127.0.0.1:8088" in the logs
           8. You can also verify it by opening clustering console( (http://localhost:4502/libs/granite/cluster/content/admin.html)). Now make changes in any of the pages on master instance. e,g, http://localhost:4502/cf#/content/geometrixx/en/products.html . This change should appear on the same page on slave instance too.     

      Troubleshooting steps

      Problem - Dispatcher is set properly but caching is not working.
      Possible root cause could be that cache rules are allowing everything. e.g. it could be like below.
      /rules
              {
              /0000
                {
                /glob "*"
                /type "allow"
                }
      Deny everything on * and then selectively allow on some directories as shown below and caching should work.
      /rules
              {
              /0000
                {
                /glob "*"
                /type "deny"
                }
              /0001
                {
                /glob "/libs/*"
                /type "allow"
                }       
              /0002
                {
                /glob "/apps/*"
                /type "allow"
                }

      Problem - Dispatcher is not caching url having query string
      Reason behind is that caching is not allowed with url having query string. In case you want to allow it, add below configuration in dispatcher. Here "q" is the query parameter. You can allow as many query parameter as you want.

      /ignoreUrlParams
              {
              /0001 { /glob "*" /type "deny" }
              /0002 { /glob "q" /type "allow" }
              }

      Problem - How to handle multiple sites with one dispatcher?
      Solution is to add multiple farms in the dispatcher.any file. e.g. 
      # each farm configures a set off (loadbalanced) renders
      /farms
        {
        # first farm entry
        /firstwebsite
          {
      # Set first website rules for dispatcher including setting up seperate cache directory
      }
      # first farm entry
        /secondwebsite
          {
      # Set second website rules for dispatcher including setting up seperate cache directory
      }
      }

      Comments

      Popular posts from this blog

      Brief guide to ecommerce

      CQ - How to set replication automatically from Author instance to publisher instance

      New age career opportunities in Information Technology after graduation