Set up repository clustering via external Hazelcast - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

Managing your own Hazelcast cluster allows you to scale repository and Hazelcast instances independently, while also allowing you to manage resources allocation on an individual level. This kind of setup provides more fine-grained control at the cost of more necessary preliminary work.

  1. Prepare a valid Hazelcast XML configuration file including all caches definitions required by the repository. This can be mostly auto-generated for you by doing the following:
    1. Locate the caches.properties file within the alfresco.war:WEB-INF\lib\alfresco-repository-*.jar archive.
    2. Copy the caches.properties file to an easily accessible directory.
    3. Clone the alfresco-community-repo.git repository locally.
    4. Move into the previously cloned repository’s directory.
    5. Making sure that Python 3 is installed and available in the PATH by running the following command in your terminal of choice, replacing the path to the caches.properties file accordingly:
       python repository/scripts/hazelcast-init/generate-hazelcast-config.py -s </path/to/caches.properties>
      							
    6. You should now have an auto-generated repository/scripts/hazelcast-init/alfresco-hazelcast-config.xml file including all required caches definitions.
  2. Replace the <cluster-name> within the alfresco-hazelcast-config.xml file with a secure value that is hard to guess. For all intents and purposes this field should be treated as a password, as if matching it allows client-server / member-member connection.
  3. Add the desired network configuration to the alfresco-hazelcast-config.xml to appropriately define your cluster topology as explained by the Hazelcast Network Configurations documentation.
  4. Apply the generated XML configuration to your Hazelcast nodes according to the Hazelcast documentation.
  5. Configure the repository nodes so that they’re able to connect to your external Hazelcast cluster and won’t spin up an embedded Hazelcast instance. This can be done by setting the following repository properties:
     # turns off the embedded Hazelcast initialization
     alfresco.hazelcast.embedded=false
     # points to a single member of the Hazelcast cluster to connect to
     alfresco.hazelcast.client.address=my-hazelcast-node:5701
     # should match the cluster-name just specified in the alfresco-hazelcast-config.xml
     alfresco.cluster.name=MySecureClusterName
    					
  6. (Optional) If, after having configured all repository nodes, you notice there are Hazelcast cluster members that haven’t been configured as the alfresco.hazelcast.client.address for any of the repository nodes, then all repository nodes should be additionally configured to have the following property appropriately set:
     # should be a comma-separated list of all external Hazelcast nodes that have not been configured
     # as the alfresco.hazelcast.client.address for ANY instance within the repository cluster
     alfresco.cluster.additional-members=some-hazelcast-node:5701,some-other-hazelcast-node:5701