Configuration

Configuration files

The configuration files are located in /opt/eva4/etc folder. If the files are missing, the default values are used.

eva_config

Location: etc/eva_config

A minimal config, used by “./sbin/eva-control” shell script to start the node server:

# MAX_START_WAIT=30 # max start wait (for regular mode)
# VERBOSE_STARTUP=0 # verbose startup
# SYSTEM_NAME=node1 # override the system name
# PID_FILE=var/eva.pid # override the pid file location
# MODE=regular # or spoint
# ARGS="--connection-path server:port" # secondary point connection path
# FIPS=true # enable FIPS-140 mode

watchdog

Location: etc/watchdog

If started in the regular mode, “eva-control” script starts an additional watchdog shell script, which continuously monitors eva.core and restarts the node server in case of failures.

# INTERVAL=30
# MAX_TIMEOUT=2

Configuration registry keys

The configuration registry keys are used by the core to configure itself and additional services. To apply changes, the node server must be restarted:

/opt/eva4/sbin/eva-control restart
# or using eva-shell
eva server restart

The keys can be edited with:

/opt/eva4/sbin/eva-registry-cli edit eva/config/KEY
# or using eva-shell
eva edit config/KEY

eva/config/core

The primary core configuration

# worker threads (max recommended = number of CPUs)
workers: 1
# the default timeout
timeout: 5
# the suicide timeout, used during shutdown (the node process is forcibly
# killed after)
suicide_timeout: 15
# auto-create items coming from controllers (svc ids *.controller.* or *.plc.*)
auto_create: true
# instantly save item states. can be true (save), false (do not save) or
# contain a list of OID masks for instant save. it is recommended to save at
# least lvar states, unless they are always re-generated on the fly
instant_save: true
#instant_save:
# - lvar:#
# - sensor:group1/#
# keep action history in memory (seconds)
keep_action_history: 86400
# core process memory usage warning (bytes), the default is 128 MiB per worker
#mem_warn: 134217728
# optional inventory database (for large projects)
# NOTE: MySQL support is deprecated, use SQLite or PostgreSQL only
#inventory_db: postgres://USER:PASSWORD@HOST/DB
# for SQLite: a relative path to the runtime directory or an absolute one
#inventory_db: sqlite://inventory.db

Inventory databases

By default, EVA ICS uses Registry database to store item inventory. This may be slow for large nodes and it is recommended to switch either to SQLite (no database server required) or to PostgreSQL (requires a server installed).

Warning

When switched, the new database is empty. EVA ICS does not perform any automatic inventory conversion.

Inventory conversion between databases is not automatic, but an easy procedure, starting from eva-shell 0.2.17 as it can now export both item configurations and their states:

# export inventory from the old database
eva item export --full -o inventory.yml
# edit core configuration and switch the database
eva edit config/core
# restart the node to apply the new configuration
eva server restart
# import inventory to the new database
eva item deploy -f inventory.yml

eva/config/bus

The node bus configuration

# queue size
queue_size: 32768
# bus buffer size (core + defaults for services)
buf_size: 8192
# buffer time-to-live (microseconds)
buf_ttl: 10
# bus sockets, default timeout = core timeout
sockets:
  # always keep this one unles you know what you are doing
  - var/bus.ipc
  # allow bus calls from remotes (zero security)
  #- 0.0.0.0:7777
  # allow bus calls from remotes (with config/ACLs)
  #- path: 0.0.0.0:7778
    #buf_size: 16384 # override the default buf size
    #buf_ttl: 20 # override the default buf ttl
    #timeout: 10 # override the default timeout
    #clients: # if defined, AAA map is applied
      #- name: some.client1
        #hosts: # allowed hosts (ignored for UNUX sockets)
          #- 192.168.22.55/32
        #p2p: # allowed p2p peers
          #- "*"
        #broadcast: # allowed broadcast requests
          #- "*"
        #publish: # allowed topics to publish
          #- "#"
        #subscribe: # allowed topics to subscribe
          #- "#"

eva/config/registry

The built-in registry service configuration

# The registry database configuration
# create N reserved copies when a key is modified
auto_bak: 10
# do not create backup version for these keys/subkeys
skip_bak:
  - eva/state
  - eva/cache
# registry cache size (items)
cache_size: 10000
# strict data schema (keep this)
strict_schema: true
# auto-flush all operations to disk (crash-free)
auto_flush: true

eva/config/logs

Logging configuration

# Core logger configuration
# Levels: trace, debug, info, warn, error
# Only a single console/memory/bus logger is supported
- output: console
  level: info
- output: bus
  level: info
- output: memory
  level: info
  keep: 86400
  max_records: 1000000
- output: file
  level: info
  # regular / json
  format: regular
  path: log/eva.log
- output: syslog
  level: info

eva/config/python-venv

Configuration of the optional Python virtual environment. To apply changes, it must be rebuilt with the command:

/opt/eva4/sbin/venvmgr build
# use system PIP
use_system_pip: false
# path to Python executable
python: python3
# use system site packages
system_site_packages: false
# skip packages (enable system site packages to let venv use preinstalled)
skip: []
# - pandas
# specify extra PIP3 options e.g., -v for verbose
pip_extra_options: ""
# additional module
extra: []
# - eva-shell
# mirror moduls for additional Python versions
mirror_extra_versions: []

Troubleshooting

If certain parts of the configuration are missing or contain invalid values, the node may stop starting. Sometimes there may be no messages in logs, e.g. if the core or the logging system configuration is broken.

In this case, launch the node server in verbose mode with the console output:

/opt/eva4/sbin/eva-control launch

Or using eva-shell:

eva server launch