Server local configuration (local.cfg.json)

Purpose

Startup parameters of the server’s central node that are needed before the platform configuration is received: node name and address, ports, directories, cluster key (psk).

The file exists on every server and is changed only on disk. The configuration master, API, and scripts do not read or modify it.

Location and access

  • Path: /var/lib/era/_workdir/erainstaller/local.cfg.json.

  • Permissions 0600, owner is the user the platform runs as (root or, in a container, era). The central node enforces these permissions on startup.

Usage principle

  • Created by the installer when the server is installed (era install): values are taken from installation parameters (srvname, srvip, psk, distports).

  • Read on every server start: by the era start script (/usr/bin/era; in a container it is invoked by docker_entrypoint.sh) and by the central node.

  • Changes take effect from the next server start (era start, container restart).

When to change

  • You need to change a central node startup parameter without reinstalling: port range, directories, Erlang path.

  • You need to set the cluster key psk (for example, the server is moved to another cluster): the value can be written in plaintext; on startup it is masked.

  • You need node connections to be accepted on all server interfaces rather than only on the address from the central node name: dist_listen_any.

srvname and srvhost form the central node name and must match the server in the platform configuration (server name and the address of the logiface interface). psk is the same on all cluster servers.

Structure

JSON object:

{
  "erl_rootdir": "/usr/lib/era/erlang",
  "psk": "ha_v=4;g4veLkEJSYXG1OWHY33Kxg",
  "srvname": "srv01",
  "srvhost": "192.168.0.10",
  "pipe_dir": "/var/run/era",
  "work_dir": "/var/lib/era/_workdir",
  "min_dist_port": 9300,
  "max_dist_port": 9309,
  "dist_listen_any": false
}

Keys

Key Type Description Example

erl_rootdir

string

Platform Erlang/OTP directory (bin/erl, bin/run_erl).

"/usr/lib/era/erlang"

psk

string

Cluster key from which node cookies are built. The same on all cluster servers. Stored masked; a plaintext value is accepted and replaced with a masked one on startup. Secret: when the file is read, it is ciphertext of the built-in key ha_v=4;…​ (protection against accidental viewing, removed by platform code); it is not encrypted with the installation key (Encryption and keys).

"ha_v=4;g4veLkEJSYXG1OWHY33Kxg"

srvname

string

Server name in the configuration, short name of the central node.

"srv01"

srvhost

string

Server address, the host of the central node name <srvname>@<srvhost>.

"192.168.0.10"

pipe_dir

string

Directory of node run_erl channels (to_erl connection).

"/var/run/era"

work_dir

string

Node working directory.

"/var/lib/era/_workdir"

min_dist_port

int

Start of the central node distribution port range.

9300

max_dist_port

int

End of the central node distribution port range.

9309

dist_listen_any

boolean

Optional. true — nodes and epmd accept connections on all interfaces (0.0.0.0). Default false: on the srvhost address if it exists on the server (or the name if it resolves to exactly one server address), otherwise on all interfaces. epmd changes the address only when it restarts.

true