ClusterBootstrapOptionsType
Esta página aún no está disponible en tu idioma.
ClusterBootstrapOptionsType =
object
Defined in: src/cluster/ClusterBootstrapOptions.ts:28
Options accepted by Cluster.bootstrap. Everything is
optional except name; sensible defaults turn the call into a
single-line hello-cluster. Build one with ClusterBootstrapOptions.
Properties
Section titled “Properties”awaitReady?
Section titled “awaitReady?”
readonlyoptionalawaitReady?:boolean|number
Defined in: src/cluster/ClusterBootstrapOptions.ts:146
Wait for this node’s SelfUp event before resolving.
true(default) — wait up to 5 000 ms.false/0— return immediately.- a number — wait at most that many ms.
On timeout the returned promise still resolves — the cluster keeps trying in the background. Set a custom value when seed contact is slow (e.g. K8s pod start lag).
config?
Section titled “config?”
readonlyoptionalconfig?:ActorSystemOptionsType["config"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:37
configFile?
Section titled “configFile?”
readonlyoptionalconfigFile?:ActorSystemOptionsType["configFile"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:38
discovery?
Section titled “discovery?”
readonlyoptionaldiscovery?:"auto"|"kubernetes"|"dns"|"config"|SeedProvider| {providers:ReadonlyArray<SeedProvider>; }
Defined in: src/cluster/ClusterBootstrapOptions.ts:86
Discovery strategy. Values:
'auto'(default) — env-driven autoDiscovery chain.'kubernetes' | 'dns' | 'config'— pin to a single provider, still configured from env vars.- a
SeedProviderinstance — use as-is. { providers: [...] }— assemble a custom aggregate chain.
Ignored when seeds is set.
downing?
Section titled “downing?”
readonlyoptionaldowning?:ClusterOptionsType["downing"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:126
failureDetector?
Section titled “failureDetector?”
readonlyoptionalfailureDetector?:ClusterOptionsType["failureDetector"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:124
gossipIntervalMs?
Section titled “gossipIntervalMs?”
readonlyoptionalgossipIntervalMs?:ClusterOptionsType["gossipIntervalMs"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:125
readonlyoptionalhost?:string
Defined in: src/cluster/ClusterBootstrapOptions.ts:58
Bind host. Default resolution order:
options.hostprocess.env.POD_IP(Kubernetes)process.env.HOSTNAME'0.0.0.0'
logger?
Section titled “logger?”
readonlyoptionallogger?:ActorSystemOptionsType["logger"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:35
Optional logger / log level / config overrides — forwarded to ActorSystem.create.
logLevel?
Section titled “logLevel?”
readonlyoptionallogLevel?:ActorSystemOptionsType["logLevel"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:36
readonlyname:string
Defined in: src/cluster/ClusterBootstrapOptions.ts:32
ActorSystem name.
persistence?
Section titled “persistence?”
readonlyoptionalpersistence?:ActorSystemOptionsType["persistence"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:39
readonlyoptionalport?:number
Defined in: src/cluster/ClusterBootstrapOptions.ts:64
Bind port. Default: process.env.CLUSTER_PORT (when present and
a finite integer), otherwise 2552.
receptionist?
Section titled “receptionist?”
readonlyoptionalreceptionist?:boolean
Defined in: src/cluster/ClusterBootstrapOptions.ts:133
Auto-start the Receptionist extension so service-key
lookups (Find, Subscribe) work without explicit wiring.
Default: true.
roles?
Section titled “roles?”
readonlyoptionalroles?:ClusterOptionsType["roles"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:123
seeds?
Section titled “seeds?”
readonlyoptionalseeds?:ReadonlyArray<string>
Defined in: src/cluster/ClusterBootstrapOptions.ts:73
Explicit seed list. When set, discovery is ignored and the
cluster contacts exactly these addresses.
shutdownOnSignals?
Section titled “shutdownOnSignals?”
readonlyoptionalshutdownOnSignals?:boolean|ReadonlyArray<NodeJS.Signals>
Defined in: src/cluster/ClusterBootstrapOptions.ts:47
Whether the bootstrap helper installs SIGTERM + SIGINT
handlers that call the returned shutdown() once. Set
to a list of signals to customise, or to false to disable.
Default: ['SIGTERM', 'SIGINT'].
stableObservation?
Section titled “stableObservation?”
readonlyoptionalstableObservation?:boolean|StableObservationTuning
Defined in: src/cluster/ClusterBootstrapOptions.ts:121
Run the stable-observation phase before joining (#148).
- unset /
false(default) — resolve the seeds once and join, the v0.9.0 behaviour. true— poll discovery until the contact-point set has been unchanged for the stable margin, then let exactly one node (the lowest-addressed) form a cluster if no peer promoted it in time.- an options object — the same, with the timings overridden. Unset
fields fall through to
actor-ts.cluster.bootstrap.*and then to the built-in defaults.
Turn it on wherever nodes start simultaneously and discovery is dynamic —
a Kubernetes Deployment, an autoscaling group, anything where DNS
propagation races pod readiness. It closes the cold-start split brain
(each node forming a cluster out of the subset it happened to see) and
the symmetric-seed-list deadlock (every node listing every other, so no
node has the empty seed list that 'immediate' self-election needs).
It costs at least stableMarginMs of startup latency and requires this
node’s advertised host to be a real address rather than a
wildcard — the election is ordered on it (see #944).
Works with an explicit seeds list too: discovery is then a fixed set, the margin is satisfied on the second poll, and what remains is the election — which is exactly what a symmetric seed list is missing.
transport?
Section titled “transport?”
readonlyoptionaltransport?:ClusterOptionsType["transport"]
Defined in: src/cluster/ClusterBootstrapOptions.ts:67
Transport override. Default: TcpTransport.
