0.0.5 • Published 11 years ago

redis-watchtower v0.0.5

Weekly downloads
24
License
-
Repository
github
Last release
11 years ago

Redis-Watchtower

A node.js client library for Redis Sentinel

install

npm install redis-watchtower

usage

First of all reference redis-watchtower as follows:

var watchtower = require('redis-watchtower');

Connect to Redis Sentinel, passing in details of your sentinel servers:

var settings = {
	masterName: 'mastername',
	sentinels: [{
		host: '127.0.0.1',
		port: 26379
	}]
};

watchtower.connect(settings, function(err) {
	if(err) {
		console.log(err.message);
	} else {
		console.log('Connected to Sentinel');
	}	
});

You may now create redis clients, and use them as normal:

var client = watchtower.createClient();

client.get('key1', function(err, data) {
	console.log('key1: ' + data);
	client.quit();
});
0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago