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 (rootor, 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 startscript (/usr/bin/era; in a container it is invoked bydocker_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 |
|---|---|---|---|
|
string |
Platform Erlang/OTP directory ( |
|
|
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 |
|
|
string |
Server name in the configuration, short name of the central node. |
|
|
string |
Server address, the host of the central node name |
|
|
string |
Directory of node |
|
|
string |
Node working directory. |
|
|
int |
Start of the central node distribution port range. |
|
|
int |
End of the central node distribution port range. |
|
|
boolean |
Optional. |
|