blob: af96af32841e40d8aeb8205c29bc147209caca84 [file] [log] [blame]
PrakashH3bcb00f2019-01-22 08:19:43 +00001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
PrakashH3bcb00f2019-01-22 08:19:43 +00004High-level architecture of Heartbeat Microservice
5=================================================
6
PrakashH1e19c182019-01-22 11:24:06 +00007**Heartbeat Microservice** startup script (misshtbtd.py) gets the
PrakashH3bcb00f2019-01-22 08:19:43 +00008configuration from CBS and parses these entries and saves them in the
9postgres database having table name **vnf_table_1**. Each entry in the
10configuration is for a particular eventName. Each entry has missed
11heartbeat count, heartbeat interval, Control loop name etc. along with
12many other parameters.
13
14Whenever a heartbeat event is received, the sourceName, lastEpochTime
15and other information is stored in another postgres database having
16table name **vnf_table_2**. It is designed to process the heartbeat event
17having different sourceNames having same eventName. In such case,
18sourceName count is maintained in vnf_table_1 which would give number of
19SouceNames that have same eventName. As and when new sourceName is
20received, sourceName count is incremented in vnf_table_1
21
22The heartbeat Microservice is designed to support multiple instances of
23HB Microservice to run simultaneously. The first instance of the HB
24Microservice would assume the role of active instance, and instances
25that started running later would become inactive instances. If the
26active HB microservice is not responding or killed, the inactive HB
27instance would take over the active role. To achieve this functionality,
28one more postgres table **hb_common** is introduced which has parameters
29specific to active instances such as process id/hostname of the active
30instance, last accessed time updated by active instance.
31
32Heartbeat Microservice supports the periodic download of CBS
33configuration. The periodicity of download can be configured.
34
35Heartbeat Microservice also supports the download of CBS configuration
36whenever configuration changes. Here Docker container would call the
37function/method to download the CBS configuration.
38
39The heartbeat microservice has 2 states
40
PrakashH1e19c182019-01-22 11:24:06 +000041**Reconfiguration state** Download configuration from CBS and update
PrakashH3bcb00f2019-01-22 08:19:43 +000042the vnf_table_1 is in progress.
43
44**Running state** Normal working that comprises of receiving of HB
45events and sending of control loop event if required conditions are met.