Registry / database / simple-redis-sentinel

simple-redis-sentinel

JSON →
library0.0.16jsnpmunverified

Manages Redis connections via Sentinel for high availability. Current stable version is 0.0.16. Provides automatic failover handling and separate master/slave client pools. Low-level, callback-based API versus alternatives like ioredis which offer higher-level abstractions. Not actively maintained; last release years ago.

npm install simple-redis-sentinel
INSTALL
IMPORT
SIG · SIMPLE-REDIS-SENTI
S
simple-redis-sentinel
databasejavascriptv0.0.16
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sentinel
const Sentinel = require('simple-redis-sentinel')
import { Sentinel } from 'simple-redis-sentinel'
Library uses CommonJS; no named exports. Use require.
default
const Sentinel = require('simple-redis-sentinel')
import Sentinel from 'simple-redis-sentinel'
No default export in types; require is required.
Sentinel
import Sentinel = require('simple-redis-sentinel')
import { Sentinel } from 'simple-redis-sentinel'
If using TypeScript with esModuleInterop, use import = require.

Initializes a Sentinel manager, connects to master/slave, and performs a simple write.

const Sentinel = require('simple-redis-sentinel'); const clusterName = 'mymaster'; const sentinelEndpoints = [ { host: '127.0.0.1', port: 26379 }, { host: '127.0.0.1', port: 26380 } ]; const options = { useSlave: true, redisConnectOptions: { retry_max_delay: 10000 } }; const manager = new Sentinel(clusterName, sentinelEndpoints, options); manager.init((err, res) => { if (!err) { const master = manager.getMasterClientById('master'); const slave = manager.getSlaveClientById('slave'); master.set('key', 'value'); } });
Debug
Known issues
breakingRequires Node.js >= 6; older versions not supported.
fix
Update Node.js to version 6 or higher.
affects: <0.0.1
deprecatedLibrary not actively maintained; may fail with newer Redis servers.
fix
Consider using ioredis with built-in Sentinel support.
affects: >=0.0.16
gotchagetMasterClientById and getSlaveClientById require a string id; defaults to 'master' and 'slave'.
fix
Use strings like 'master' or 'slave' as per documentation.
affects: >=0.0.1
gotchaManager must be initialized with init() before using clients; otherwise null is returned.
fix
Call manager.init(callback) before calling getMasterClientById.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:26379 failed
Sentinel endpoints not reachable or wrong host/port.
fix
Ensure sentinel servers are running and accessible.
TypeError: manager.getMasterClientById is not a function
Manager not initialized or import incorrect.
fix
Use const S = require('simple-redis-sentinel') and call new S(...).init(cb).
ReferenceError: Sentinel is not defined
CommonJS require not used or wrong import.
fix
Use const Sentinel = require('simple-redis-sentinel').
Upgrade
Version history
0.0.16latest on npm
Audit
Dependencies
redisrequiredUnderlying Redis client for connections
Agent activity
17 hits · last 30 days
node
14
Meta
1
Resources
simple-redis-sentinel — npm install simple-redis-sentinel · libregistry