Manage Cluster Nodes
Since 4.1, 4.0.2
This functionality is available since version 4.1, 4.0.2.
|
MidPoint can run in clustered mode with two or more nodes. This article describes the most important parameters influencing how nodes are named and managed.
How to Construct a Node Identifier
Each node in cluster must have a unique node identifier (name).
The property to use is nodeId
.
MidPoint configuration properties support expressions in the form of ${variable}
or ${prefix:variable}
.
The first form evaluates using a configuration option specified by variable
. The second one is more general and supports the following prefixes:
Prefix | Meaning | Example |
---|---|---|
|
References Java system properties. |
|
|
References operating system environment variables. |
|
|
References local host name as determined by midPoint. The colon after hostname is obligatory. |
|
|
Generates random node ID.
The full format is |
|
|
Uses first available node ID in a given sequence.
The full format is |
|
The sequence
expression works like this:
-
The counter starts at the
start
value, incrementing by 1 up to theend
value, inclusive. -
At each step, the node name is determined using the formatting string and other parts of the expression, and is checked for availability.
-
If such a node does not exist in the repository, the name is used. Technically speaking, the node name is allocated by creating the node in the repository. If the operation succeeds, the node is acquired. This is to avoid race condition: only the first midPoint instance that successfully creates a node object can use this name.
-
If a node with the given name exists, but the node is permanently down (this is determined by the
running
property being set tofalse
), the name is used. This is implemented by removing the node object and then retrying the allocation attempt. -
Names of nodes that are not marked as down but are not alive either, are not used here. This is to avoid using names of nodes that are currently booting, or temporarily unavailable, for instance. See the Node state management section below.
The sequence
expression can be combined with other name constituents.
For example, you can specify the nodeId
as ${env:ENVIRONMENT}-${sequence:0:99:%02d}
, yielding names like Test-01
, Test-02
, …, QA-01
, QA-02
, …, Prod-01
, Prod-02
, …
Node State Management
A midPoint node can be in one of the following states:
State | Characterization |
---|---|
up and alive |
The node regularly checks into the repository.
Its |
up, but not checking in |
There’s an issue with the node.
Its |
down |
The |
starting |
The |
deleted |
The node object no longer exists in the repository.
The deletion can occur either manually or by a cleanup task.
The task deletes nodes that have |
Timeout and Check Interval Default Values
Parameter | Location | Description | Default value |
---|---|---|---|
|
|
When to start considering a node as not checking in. |
30 seconds |
|
|
When to start considering a node as being down. |
900 seconds |
|
|
How often is a node availability check carried out. |
120 seconds |
|
|
When to start reporting a node as starting for too long. |
900 seconds |
|
cleanup policy, e.g., in the system configuration object |
How long can a node go without check-in before it is deleted. |
none[1] |