How does HA and data duplication work?
As we just said, HA duplicates all incoming resource data so that two copies exist instead of one in both the GemFire cache and Persistence layers. This is done by creating a secondary copy of each piece of data that is used in queries, if the node hosting a primary copy is unavailable.
It is important to note that as HA is simply creating a secondary copy of each piece of data, as such only one node failure can be sustained at a time (N-1) without data loss, regardless of the cluster size. If a node is down, a new secondary shard of the data is not created unless the original node is removed from the cluster permanently.
When a failed node becomes available again, a node is placed into recovery mode. During this time, data is synchronized with the other cluster members and when the synchronization is complete, the node is returned to active status:
Let's run through this process using the diagram above for an example, about how incoming data or the creation of a new object is handled in an HA configuration. In the above diagram, R3 represents our new resource, and R3' represents the secondary copy:
- A running adapter instance receives data from vCenter, as it is required to create a new resource for the new object, and a discovery task is created.
- The discovery task is passed to the cluster. This task could be passed to any one node in the cluster, and once assigned, that node is responsible for completing the task.
- A new analytics item is created for the new object in the GemFire cache on any node in the cluster.
- A secondary copy of the data is created on a different node to protect against failure.
- The system then saves the data to the Persistence layer. The object is created in the inventory (HIS), and its statistics are stored in the FSDB.
- A secondary copy of the saved (GemFire Persistence sharding) HIS and FSDB data is stored on a different node to protect against data loss.
The following diagram shows the same duplication process, but this time for a non-HA setup:
In a non-HA scenario, the following happens when a new object is discovered:
- A new object is discovered by the adapter, which is located in the Collector.
- The Collector receives the object’s metric and property information from the adapter.
- The Collector sends the object information to the Controller.
- The global database is updated with the new object type information. The object is created in the central database.
- The object is also cached by the analytics component.
- The Alerts database is updated with object information.