Some basic concepts first
- a server cluster is a set of servers that work as one.
- a server cluster is consisted of servers called nodes.
- each node must run in a machine
- a machine can be physical or virtual
ClusterJ constitution
ClusterJ is made up of three parts:
- Primary Server (PS): tomcat hosting the .war responsible for receive the client’s request.
- Secondary Server (SS): tomcat hosting the .war responsible for receiving the PS requests to perform operations:
- node installation
- machine statistics update
- start/stop nodes
- Tertiary Server (TS): The TS is the tomcat hosting the user’s .war.

In this picture, we have:
- Machine 2: PS
- Machine 4: SS and TS
- Machine 3: The setup database (SDB)
- Machine 5: The user database (UDB)
Primary Server
This is the Tomcat hosting the clusterj-cluster-manager-api.war (CCMA).
The CCMA has the endpoints for clusterj management:
- Cluster creation
- Cluster queries
- Machines startup
- Cluster startup
Secondary Server
This is the Tomcat hosting the clusterj-node-manager-api.war (CNMA).
Each node in ClusterJ has the following characteristics:
- Linux account: each node is restricted to a linux account
- Dedicated JVM: each node runs in its own JVM
- Dedicated Tomcat: each node has its own Tomcat
The CNMA has the endpoints for node management:
- Linux account creation
- Tomcat installation
- startup.sh and shutdown.sh customization
- upload .wars of the user
- node startup/shutdown
Tertiary Server
Tomcat hosting the user’s .wars.
A cluser of 3 nodes means:
- There will be 3 tertiary servers (tomcats) hosting the same .war
- Each to the tomcats will be listening in its own port
- Any of these 3 tomcats will be able to perform the request from the PS
- The .wars in these nodes will handle the same database