Registry database

Starting from the version 3.4, EVA ICS uses structured document database as the primary storage of all configurations. In EVA ICS it is called “registry system” or just “registry”.

Technology

EVA ICS uses YEDB as the structured database. YEDB is fast, easy to repair and crash-free.

Registry service is embedded into the node server and is always started automatically.

Registry can be managed with “bin/eva-registry”, “eva registry manage” and “sbin/eva-registry-cli” command-line tools.

Reasons

Why EVA ICS has been switched to the registry database, instead of using simple “ini” and “json” files:

  • Crash-free storage of configurations, inventory and data objects;

  • easy management with command line tools and API;

  • strict data schemas;

  • unification;

  • easy-to-use SDK.

Maintenance

When deploying / undeploying lots of items, removed/overridden registry keys are not deleted but moved to the database trash. It is a good idea to clean it from time to time with “eva-registry purge” or “registry_safe_purge” API method.

“.trash” folder can also be used to restore keys deleted by accident.

When key data is changed, the server keeps its 10 backup copies by default, which can be also used to restore data if necessary.

To list deleted and backup copies, use “ls -a” command of “eva-registry” tool.

All data is stored in “runtime/registry” directory, which should not be accessed directly, unless data loss occur.

Starting the registry service only

The following command:

EVA_NODE_MODE=registry /opt/eva4/bin/eva-control start

allows to temporary start the registry database server only.

Bus cheat-sheet

“eva.registry” service accepts all YEDB API calls via the local bus.

Purge

To automatically purge the registry, e.g. after undeploying multiple items, execute:

/opt/eva4/sbin/bus /opt/eva4/var/bus.ipc rpc call eva.registry safe_purge

The same can be done with eva-shell:

eva svc call eva.registry safe_purge

Temporary enable/disable auto-flush

To deploy multiple items, it may be useful to disable the registry auto-flush feature:

/opt/eva4/sbin/bus /opt/eva4/var/bus.ipc rpc call eva.registry server_set name=auto_flush value=false

The same can be done with eva-shell:

eva svc call eva.registry server_set name=auto_flush value=false

Structure

Each EVA ICS node creates registry key “eva”, all data is being stored in its sub-keys.

A strict schema “.schema/eva” is created for all data keys, except “user_data” and “svc_data”, which (as well as their sub-keys) can contain any fields.

Keys can be edited with “eva-registry” and “eva-registry-cli” CLI tools.

Key

user-editable

Description

config/bus

yes

the local bus configuration

config/core

yes

the primary node configuration

config/python-venv

yes

Python venv configuration

config/registry

yes

the registry service configuration

config/logs

yes

logging configuration

data

forbidden

system objects

inventory

not rec.

inventory key (EVA ICS items)

state

not rec.

item states

svc

not rec.

external service configuration

svc_data

not rec.

used by external services

user_data

yes

any user-defined data