Repository navigation
Expand file tree
/
Copy pathapplication.conf
More file actions
56 lines (52 loc) · 2.23 KB
/
Copy pathapplication.conf
File metadata and controls
56 lines (52 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## actor-ts chat sample — HOCON configuration.
##
## Fields here are read by the framework on `ActorSystem.create(...)`.
## CLI flags from `backend/config.ts` (host, ports, seeds) win over
## anything set here when the chat sample wires the cluster up; this
## file is the place to tune knobs that don't change per-node (gossip
## cadence, failure detection, downing, journal plugin, log level).
actor-ts {
# Logging. Accepted values: debug, info, warn, error, off.
logger {
level = "debug"
}
# Persistence — SQLite journal and snapshot store, so chat history and
# room recovery both survive a restart. These two ids are what selects
# them: `backend/main.ts` passes registerSqlitePlugins() to the system as
# a plug-in (`withPersistence({ plugins })`), which registers the
# plug-ins under exactly these names before `ActorSystem.create` returns.
# The two file paths are set in code (under `--data-dir`, default
# `data/`) — putting them here would tie every reader to one working
# directory. See `backend/main.ts`.
persistence {
journal {
plugin = "actor-ts.persistence.journal.sqlite"
}
snapshot-store {
plugin = "actor-ts.persistence.snapshot-store.sqlite"
}
}
# Cluster timing — tightened for a 3-node local demo: a node that dies is
# flagged unreachable after 1.5 s of silence instead of the shipped 2 s.
cluster {
failure-detector {
heartbeat-interval = 300ms
unreachable-after = 1500ms
down-after = 4s
}
gossip-interval = 500ms
# Who removes a node that dies without leaving. With no strategy the
# failure detector removes a silent node itself at down-after (4 s here)
# and the survivors take over the rooms it hosted -- but under a real
# partition both sides remove each other and run on as two chat clusters.
# keep-majority lets the two survivors of three remove it once the view
# has held still for stable-after -- about 1.5 s + 3 s after the kill
# here -- and the minority side of a real partition removes itself
# instead of forking the cluster. A Ctrl+C is a graceful leave and needs
# none of this.
split-brain-resolver {
active-strategy = keep-majority
stable-after = 3s
}
}
}