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']),);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ClusterOptionsBuilder():
ClusterOptionsBuilder
Returns
Section titled “Returns”ClusterOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withDowning()
Section titled “withDowning()”withDowning(
downing):this
Defined in: src/cluster/ClusterOptions.ts:349
Optional split-brain resolver (KeepMajority, KeepOldest, …).
Parameters
Section titled “Parameters”downing
Section titled “downing”Returns
Section titled “Returns”this
withFailureDetector()
Section titled “withFailureDetector()”withFailureDetector(
failureDetector):this
Defined in: src/cluster/ClusterOptions.ts:295
Failure-detector thresholds (merged over the built-in defaults).
Parameters
Section titled “Parameters”failureDetector
Section titled “failureDetector”Partial<FailureDetectorOptionsType>
Returns
Section titled “Returns”this
withGossipIntervalMs()
Section titled “withGossipIntervalMs()”withGossipIntervalMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:305
How often gossip is pushed to a random reachable peer.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withHost()
Section titled “withHost()”withHost(
host):this
Defined in: src/cluster/ClusterOptions.ts:275
Bind host.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
withMaxFrameBytes()
Section titled “withMaxFrameBytes()”withMaxFrameBytes(
maxFrameBytes):this
Defined in: src/cluster/ClusterOptions.ts:354
Per-frame wire cap for the cluster’s own transport. Default: 16 MiB.
Parameters
Section titled “Parameters”maxFrameBytes
Section titled “maxFrameBytes”number
Returns
Section titled “Returns”this
withMaxMembers()
Section titled “withMaxMembers()”withMaxMembers(
maxMembers):this
Defined in: src/cluster/ClusterOptions.ts:359
Cap on live member entries gossip may introduce. 0 disables. Default: 1000.
Parameters
Section titled “Parameters”maxMembers
Section titled “maxMembers”number
Returns
Section titled “Returns”this
withMaxTombstones()
Section titled “withMaxTombstones()”withMaxTombstones(
maxTombstones):this
Defined in: src/cluster/ClusterOptions.ts:364
Cap on removed tombstones gossip may introduce. 0 disables. Default: 10000.
Parameters
Section titled “Parameters”maxTombstones
Section titled “maxTombstones”number
Returns
Section titled “Returns”this
withMaxVersionSkewMs()
Section titled “withMaxVersionSkewMs()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withPort()
Section titled “withPort()”withPort(
port):this
Defined in: src/cluster/ClusterOptions.ts:280
Bind port.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withRoles()
Section titled “withRoles()”withRoles(
roles):this
Defined in: src/cluster/ClusterOptions.ts:290
Role tags exposed to other members — constrain sharding placement.
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”this
withSeedRetryIntervalMs()
Section titled “withSeedRetryIntervalMs()”withSeedRetryIntervalMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:310
How often to resend the initial join gossip to seeds until self is Up.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withSeeds()
Section titled “withSeeds()”withSeeds(
seeds):this
Defined in: src/cluster/ClusterOptions.ts:285
Other nodes this node should try to contact on startup.
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”this
withSelfElection()
Section titled “withSelfElection()”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.
Parameters
Section titled “Parameters”selfElection
Section titled “selfElection”Returns
Section titled “Returns”this
withTombstoneMinRetentionMs()
Section titled “withTombstoneMinRetentionMs()”withTombstoneMinRetentionMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:325
Minimum age before a tombstone is eligible for pruning. Default 6 × downAfterMs.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withTombstonePruneIntervalMs()
Section titled “withTombstonePruneIntervalMs()”withTombstonePruneIntervalMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:320
How often the tombstone-prune pass runs. Default 5 min.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withTombstoneTtlMs()
Section titled “withTombstoneTtlMs()”withTombstoneTtlMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:315
How long to keep a removed tombstone before pruning it. Default 24 h.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withTransport()
Section titled “withTransport()”withTransport(
transport):this
Defined in: src/cluster/ClusterOptions.ts:300
Override the transport (e.g. InMemoryTransport for tests).
Parameters
Section titled “Parameters”transport
Section titled “transport”Returns
Section titled “Returns”this
withWeaklyUpAfterMs()
Section titled “withWeaklyUpAfterMs()”withWeaklyUpAfterMs(
ms):this
Defined in: src/cluster/ClusterOptions.ts:335
Auto-promote joining → weakly-up after this many ms. 0 disables (default).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():ClusterOptionsBuilder
Defined in: src/cluster/ClusterOptions.ts:270
Start a fresh builder. Equivalent to new ClusterOptionsBuilder().
Returns
Section titled “Returns”ClusterOptionsBuilder
