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