Set Up CQ Cluster




CQ Clustering


Set Up CQ Cluster

There are various ways you can set up cluster in CQ. Two most common ways are
  • Automatic Cluster Join through UI
  • Manual Cluster Join

In order to understand cluster knowledge of following files are important:

 File Name     Description
 /<repository path>/tarJournal This folder holds cluster sync related information 
 /<repository path>/cluster_node.id This file contains unique node id for node. This is random generated UUID.  You  can identify a node by cluster Node ID. 
 /<repository path>/cluster.properties This file contains cluster configuration and updated when nodes are added or removed within cluster. This files contains information about all the member node in cluster. There are essentially three properties that this contains. 
  • Cluster_id - This is unique ID. Which is same for all node in cluster. And it is not same as cluster node_id. If you go to any node in cluster and see this value it will be same.
  • addresses - This property contains IP address of all node in cluster. When node starts, it checks for this value to connect to other nodes.
  • members - This property contains UUID of all the members in cluster.
  /<repository path>/clustered.txt This is a marker file which tells node that this node is in cluster. As soon as node is stopped this file is deleted. If this file exist, node will always start as slave, it will never start as master. It will then try to connect to master and if it can not find master start up will fail.
   /<repository path>/revision.log This file contains information about indexing changed happened. File is used to sync search index information from master once node start up.  



Cluster Join Through UI:
  • In order to add a node to through UI. Go to welcome screen and click on "Clustering" Or go to <HOST>:<PORT>/libs/granite/cluster/content/admin.html
CQ

  • Then enter Master URL http://<HOST>:<PORT>/crx/explorer
  • Then enter UserName, Password.
  • Then click on Join

  • Once nodes are in cluster you can always go back to <HOST>:<PORT>/libs/granite/cluster/content/admin.html to check status of cluster.
  • If you Join cluster through UI. In file system you will see directory structure like /crx-quickstart/crx.XXX in slave node. Which is essentially repository for cluster.

Manual Cluster Join:
  • Assuming that you are creating Shared Nothing cluster.
  • In order to do manual cluster join. First take file system backup of any node in cluster (This mean stop any cluster node and take backup of folder containing quickstart jar file, crx-quickstart folder, And your license file). You can also take online backup (We will cover this later)
  • Put file system (backup) in other machine. (Based on how you took your backup you can restore whole file system)
  • Then go to /crx-quickstart/repository folder and remove cluster_node.id file
  • Open  /crx-quickstart/repository/cluster.properties file and add IP address of Master instance in addresses property. You can also do echo "addresses=x.x.x.x" >> crx-quickstart/repository/cluster.properties where x.x.x.x is IP of master instance.
  • Make sure that Cluster_Id is same in both master and slave instance.
  • Start Slave instance.
  • Check log of both master and Slave. In Master Log you should see message saying that slave is connected as soon as slave is started. In slave log you should see the message that connecting to master.


                                                                                                  
 
          
Comments