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.
-
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:
- Locate the caches.properties file within the alfresco.war:WEB-INF\lib\alfresco-repository-*.jar archive.
- Copy the caches.properties file to an easily accessible directory.
- Clone the alfresco-community-repo.git repository locally.
- Move into the previously cloned repository’s directory.
-
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>
- You should now have an auto-generated repository/scripts/hazelcast-init/alfresco-hazelcast-config.xml file including all required caches definitions.
- 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.
- 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.
- Apply the generated XML configuration to your Hazelcast nodes according to the Hazelcast documentation.
-
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
-
(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