The high availability of any application is critical because of the global model of organizations. Also, with high throughput, multiple servers are required to support an application. This is where the clustering of nodes comes into the picture.
The typical requirements of high availability architectures are the following:
In this chapter, we will discuss the ways of clustering in Alfresco and the backup restore process that supports the high availability of Alfresco.
By the end of this chapter, you will have learned about:
Clustering refers to collections of multiple nodes combined together in a server as a single application to end users. With clustering, you can achieve scalability, server redundancy, and performance improvement of the application.
Let's consider a global financial organization that has multiple teams working for it across the globe. Alfresco is used as an enterprise content repository to store all the financial assets, like contracts. Now, these assets are very time-critical, and therefore the contracts should be accessible to all teams working on it at any time. There are thousands of users using the application, which also requires high server performance. High throughput is required for the server for users accessing assets in the system.
To satisfy these requirements, you will need to build a robust and highly available system by creating a clustered environment of Alfresco so the load on the server can be distributed. You also need a redundant and scalable environment so if one server goes down, you have another server up and running. This allows users to access the contracts from the application at any time. Moreover, you would have minimal downtime for the application.
There are various ways in which you can divide the servers in multiple tiers as per your requirements.
This approach is a straightforward approach where you create a replica of a complete stack and enable the clustering in Alfresco. The database and content store are being shared between all the nodes. Using a load balancer in front of this stack allows requests to be divided among servers. You can use any load balancer like Apache, Nginx, etc.
With this approach, if one node goes down, the other node is capable enough to serve the request independently.
As the database and content store are shared among the servers, they are single points of failure. In addition to this, we have to manage the indexes in two Solr instances. For this, we would need a proper backup for the database and content store. More details on backup and restore will be covered later on in this chapter.
Each component of Alfresco can be divided into multiple tiers like Share, Repository, Database, and Solr. Use a load balancer to communicate between each tier. Share can either talk to the Alfresco Repository using the load balancer or an individual server. You can also have a common Solr server shared among all the nodes. Refer to the clustering diagram below for a visualization.
The database and content store are shared among the servers. This approach would be useful when you have to divide the load on the web-tier and increase the throughput of the application. In addition, indexes are available on the common Solr server, so there is no need to manage multiple instances. The Solr server can also be clustered together, which allows for easy scalability of the server.
Now we will understand the process required to cluster Alfresco nodes. As Share and Repository are different components, both require different configuration to bring them into the cluster.
First, identify what kind of clustering approach is required. Set up each node and make sure that each node as a single entity is working properly, such as being able to connect to the database and content store. Now follow the steps below to set up clustering between Alfresco nodes.
custom-slingshot-application-context.xml
file located at <Tomcat_home>/shared/classes/alfresco/web-extension
. The sample file is already located in this location..sample
file to a .xml
file and uncomment the related Hazelcast configuration. Refer to the sample code with the book.alfresco-global.properties
located at <Tomcat_home>/shared/classes/
on all nodes to point to the same database. Refer to Chapter 3, Alfresco Configuration, for configuring databases.dir.root
in the alfresco-global.properties
file is pointing to same content store on all nodes. Mount the content store file system on all the nodes with the proper permission rights.alfresco-global.properties
file and restart all Alfresco nodes. Also make sure that the default clustering port 5701
is open on all nodes:alfresco.cluster.enabled=true
Set this value to true
to enable clustering, if you set it to false
, this node would not be part of clustering.
alfresco.cluster.interface=10.208.*.*
This is the network interface to be used for clustering. You can define a wildcard value, so the system will try to bind with all interfaces having this IP address.
alfresco.cluster.nodeType= Scheduler Server
Enter a human readable node name which helps to distinguish the servers. It is mostly useful for nodes which are not part of cluster, but which share the same database and content store.
alfresco.hazelcast.password= clusterpasswd
Define the password used by clustered nodes to join or access the hazelcast
cluster. From a security standpoint, always configure this property.
alfresco.hazelcast.max.no.heartbeat.seconds=15
Configure the maximum node heartbeat timeout in seconds to assume it is dead.
http://<server_name>:<port>/alfresco/service/enterprise/admin
.Another way to manually verify clustering is by uploading and searching content or a folder in the repository. Considering we have two Alfresco servers, NODE1
and NODE2
, in the clustered environment:
NODE1
and upload some content.NODE2
and verify you are able to see the content.NODE2
and verify you are able to search it.Enable debug logs for the class files listed below to troubleshoot in more detail. Make an entry in the log4j.properties
file located at <Tomcat_home>/webapps/alfresco/WEB-INF/classes
and restart the server:
log4j.logger.org.alfresco.enterprise.repo.cluster=info
This is the main package for clustering related classes.
log4j.logger.org.alfresco.enterprise.repo.cluster.core.ClusteringBootstrap=DEBUG
This provides detail about cluster startup, shutdown, whether it is disabled or if the license is invalid.
log4j.logger.org.alfresco.enterprise.repo.cluster.core.MembershipChangeLogger=DEBUG
This provides details about the cluster members.
log4j.logger.org.alfresco.enterprise.repo.cluster.cache=DEBUG
log4j.logger.org.alfresco.repo.cache=DEBUG
log4j.logger.com.hazelcast=info
Enable this if logging is required for core hazelcast
packages.
The Hazelcast mancenter is a standalone application which allows you to monitor and manage all the servers using Hazelcast. This dashboard enables you to browse through the cluster data structure and provides you with details about the cluster. You can use this dashboard to get more details about the cluster node.
To set up this Hazelcast mancenter, follow these steps:
CATALINA_OPTS
environment variable:-hazelcast.mancenter.home=/home/<tomcat_directory>/mancenter_data
alfresco-global.properties
file. Make sure that from the Alfresco server, this mancenter service is accessible:alfresco.hazelcast.mancenter.enabled=true alfresco.hazelcast.mancenter.url=http://<tomcat-erveraddress>:<port>/mancenter
To get more details about the Hazelcast mancenter, refer to http://hazelcast.com/products/management-center/.