API reference / @chanx-js/layers / redis / RedisSentinelHost
Interface: RedisSentinelHost
Defined in: packages/layers/src/redis/index.ts:33
A master found through Redis Sentinel, as Python's {"sentinels": [...], "master_name": ...} host. The rest are node-redis Sentinel options, such as nodeClientOptions for auth.
Extends
Omit<RedisSentinelOptions,"name"|"sentinelRootNodes">
Properties
clientSideCache?
optional clientSideCache?: ClientSideCacheConfig | PooledClientSideCacheProvider;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:114
Client Side Caching configuration for sentinel.
Enables Redis Servers and Clients to work together to cache results from commands sent to a server. The server will notify the client when cached results are no longer valid. In sentinel mode, the cache is shared across all clients managed by the sentinel.
Note: Client Side Caching is only supported with RESP3.
Examples
Anonymous cache configuration
const sentinel = createSentinel({
name: 'sentinel-db',
sentinelRootNodes: [{ host: 'example', port: 1234 }],
clientSideCache: {
ttl: 0,
maxEntries: 0,
evictPolicy: "LRU"
}
});Using a controllable cache
const cache = new BasicPooledClientSideCache({
ttl: 0,
maxEntries: 0,
evictPolicy: "LRU"
});
const sentinel = createSentinel({
name: 'sentinel-db',
sentinelRootNodes: [{ host: 'example', port: 1234 }],
clientSideCache: cache
});Inherited from
Omit.clientSideCachecommandOptions?
optional commandOptions?: CommandOptions<TypeMapping>;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:117
Inherited from
Omit.commandOptionsfunctions?
optional functions?: RedisFunctions;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/RESP/types.d.ts:99
Inherited from
Omit.functionskeyPrefix?
optional keyPrefix?: RedisArgument;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:128
Prefix prepended to every key sent to Redis (ioredis-compatible keyPrefix).
Applied by the sentinel client itself. It is intentionally a sentinel-level option (not a per-node nodeClientOptions option) so it is applied exactly once.
Matches ioredis semantics: only keys sent to Redis are prefixed. Keys returned by Redis are NOT un-prefixed, MATCH patterns are NOT auto-prefixed, and Pub/Sub channels are NOT prefixed.
Inherited from
Omit.keyPrefixmasterName
masterName: string;Defined in: packages/layers/src/redis/index.ts:38
masterPoolSize?
optional masterPoolSize?: number;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:48
The number of clients connected to the master node
Inherited from
Omit.masterPoolSizemaxCommandRediscovers?
optional maxCommandRediscovers?: number;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:32
The maximum number of times a command will retry due to topology changes.
Inherited from
Omit.maxCommandRediscoversmodules?
optional modules?: RedisModules;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/RESP/types.d.ts:98
Inherited from
Omit.modulesnodeAddressMap?
optional nodeAddressMap?: NodeAddressMap;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:58
Mapping between the addresses returned by sentinel and the addresses the client should connect to Useful when the sentinel nodes are running on another network
Inherited from
Omit.nodeAddressMapnodeClientOptions?
optional nodeClientOptions?: RedisSentinelNodeClientOptions<3, TypeMapping>;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:38
The configuration values for every node in the cluster. Use this for example when specifying an ACL user to connect with.
Sentinel-level options (e.g. commandOptions) cannot be set here — set them on the top-level sentinel options instead.
Inherited from
Omit.nodeClientOptionspassthroughClientErrorEvents?
optional passthroughClientErrorEvents?: boolean;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:72
When true, error events from client instances inside the sentinel will be propagated to the sentinel instance. This allows handling all client errors through a single error handler on the sentinel instance.
Default: false
Inherited from
Omit.passthroughClientErrorEventsreplicaPoolSize?
optional replicaPoolSize?: number;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:53
The number of clients connected to each replica node. When greater than 0, the client will distribute the load by executing read-only commands (such as GET, GEOSEARCH, etc.) across all the cluster nodes.
Inherited from
Omit.replicaPoolSizereserveClient?
optional reserveClient?: boolean;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:77
When true, one client will be reserved for the sentinel object. When false, the sentinel object will wait for the first available client from the pool.
Inherited from
Omit.reserveClientRESP?
optional RESP?: 3;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/RESP/types.d.ts:97
Specifies the Redis Serialization Protocol version to use. RESP3 is the default (value 3), while RESP2 (value 2) remains available for compatibility. RESP3 provides additional data types and features introduced in Redis 6.0.
Inherited from
Omit.RESPscanInterval?
optional scanInterval?: number;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:65
Interval in milliseconds to periodically scan for changes in the sentinel topology. The client will query the sentinel for changes at this interval.
Default: 10000 (10 seconds)
Inherited from
Omit.scanIntervalscripts?
optional scripts?: RedisScripts;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/RESP/types.d.ts:100
Inherited from
Omit.scriptssentinelClientOptions?
optional sentinelClientOptions?: RedisSentinelNodeClientOptions<3, TypeMapping>;Defined in: node_modules/.pnpm/@redis+client@6.3.0/node_modules/@redis/client/dist/lib/sentinel/types.d.ts:44
The configuration values for every sentinel in the cluster. Use this for example when specifying an ACL user to connect with.
Sentinel-level options (e.g. commandOptions) cannot be set here — set them on the top-level sentinel options instead.
Inherited from
Omit.sentinelClientOptionssentinels
sentinels: object[];Defined in: packages/layers/src/redis/index.ts:37
host
host: string;port
port: number;