콘텐츠로 이동
한국어

ClusterOptionsBuilder

이 콘텐츠는 아직 번역되지 않았습니다.

Defined in: src/cluster/ClusterOptions.ts:268

Fluent builder for ClusterOptionsType — the sole input to Cluster.join. host + port are required; every other knob is optional. Polymorphic / whole-value fields (transport, downing, failureDetector, roles, seeds) are passed as-is via a single withX(value) — no nested builders.

await Cluster.join(
system,
ClusterOptions.create()
.withHost('127.0.0.1')
.withPort(2552)
.withSeeds(['sys@127.0.0.1:2551']),
);

new ClusterOptionsBuilder(): ClusterOptionsBuilder

ClusterOptionsBuilder

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withDowning(downing): this

Defined in: src/cluster/ClusterOptions.ts:349

Optional split-brain resolver (KeepMajority, KeepOldest, …).

DowningProvider

this


withFailureDetector(failureDetector): this

Defined in: src/cluster/ClusterOptions.ts:295

Failure-detector thresholds (merged over the built-in defaults).

Partial<FailureDetectorOptionsType>

this


withGossipIntervalMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:305

How often gossip is pushed to a random reachable peer.

number

this


withHost(host): this

Defined in: src/cluster/ClusterOptions.ts:275

Bind host.

string

this


withMaxFrameBytes(maxFrameBytes): this

Defined in: src/cluster/ClusterOptions.ts:354

Per-frame wire cap for the cluster’s own transport. Default: 16 MiB.

number

this


withMaxMembers(maxMembers): this

Defined in: src/cluster/ClusterOptions.ts:359

Cap on live member entries gossip may introduce. 0 disables. Default: 1000.

number

this


withMaxTombstones(maxTombstones): this

Defined in: src/cluster/ClusterOptions.ts:364

Cap on removed tombstones gossip may introduce. 0 disables. Default: 10000.

number

this


withMaxVersionSkewMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:330

Cap on how far ahead of the local clock a gossiped member version may be. Default 5 min.

number

this


withPort(port): this

Defined in: src/cluster/ClusterOptions.ts:280

Bind port.

number

this


withRoles(roles): this

Defined in: src/cluster/ClusterOptions.ts:290

Role tags exposed to other members — constrain sharding placement.

string[]

this


withSeedRetryIntervalMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:310

How often to resend the initial join gossip to seeds until self is Up.

number

this


withSeeds(seeds): this

Defined in: src/cluster/ClusterOptions.ts:285

Other nodes this node should try to contact on startup.

string[]

this


withSelfElection(selfElection): this

Defined in: src/cluster/ClusterOptions.ts:344

When this node may declare itself the first member of a new cluster. 'immediate' (default), 'never', or a millisecond delay — see SelfElectionPolicy.

SelfElectionPolicy

this


withTombstoneMinRetentionMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:325

Minimum age before a tombstone is eligible for pruning. Default 6 × downAfterMs.

number

this


withTombstonePruneIntervalMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:320

How often the tombstone-prune pass runs. Default 5 min.

number

this


withTombstoneTtlMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:315

How long to keep a removed tombstone before pruning it. Default 24 h.

number

this


withTransport(transport): this

Defined in: src/cluster/ClusterOptions.ts:300

Override the transport (e.g. InMemoryTransport for tests).

Transport

this


withWeaklyUpAfterMs(ms): this

Defined in: src/cluster/ClusterOptions.ts:335

Auto-promote joiningweakly-up after this many ms. 0 disables (default).

number

this


static create(): ClusterOptionsBuilder

Defined in: src/cluster/ClusterOptions.ts:270

Start a fresh builder. Equivalent to new ClusterOptionsBuilder().

ClusterOptionsBuilder