3 Configuration

classy is configured via OTP application environment variables and callbacks.

3.1 General

setup_hooks

Type: mfargs()

A callback that classy executes during startup. It allows business applications to set up other hooks using a more type-safe API.

table_dir

Type: file:filename()

Default: "."

Directory where persistent data is stored. It should be writable.

rpc_timeout

Type: timeout()

Default: 5000

Unit: ms

Default timeout for remote procedure calls.

3.2 Peer

sync_timeout

Type: non_neg_integer()

Default: 1000

Unit: ms

Maximum interval of time that can pass between the membership CRDT server receiving an update and the moment it propagates it to the peers.

n_sites

Type: pos_integer()

Default: 1

Minimum number of known peers necessary to advance run level from single to cluster.

quorum

Type: pos_integer()

Default: 1

Minimum number of known peers necessary to advance run level from cluster to quorum.

3.3 Two-phase commit

vote_retry_interval

Type: pos_integer()

Default: 5000

Unit: ms

2PC coordinator re-sends outcome of a transaction to the participants at this interval.

3.4 Autoclean

max_site_downtime

Type: pos_integer() | infinity

Default: infinity

Unit: s.

Automatically kick sites that have been down longer than this value from the cluster.

Note: to prevent network-isolated nodes from kicking their peers, quorum among the running nodes is required to perform the act.

cleanup_check_interval

Type: pos_integer()

Default: 30_000

Unit: ms.

Autoclean check interval.

forget_after

Type: pos_integer()

Default: 1w

Unit: s

Forget information about inactive (kicked) sites after this period of time.

Note: cleanup procedure may lead to the following situation:

  1. Site A goes down
  2. Site B kicks A
  3. Information about event 2 propagates throughout the cluster.
  4. Cleanup. All active peers delete data about A.
  5. A goes back up

Since at step 4 we removed the data about event 2, A will reappear in the cluster.

So forget_after should be set to a fairly large value to make sure it doesn’t cover nodes that can go back online.

3.5 Autocluster

discovery_interval

Type: pos_integer()

Default: 5_000

Unit: ms.

Peer discovery retry interval.

discovery_strategy

Type: classy_discovery_strategy:t/0

Peer discovery method, See Autocluster.


JavaScript license information