() = redis.createClient(6379, '127.0.0.1', {})
*/
RDS_PORT = 6379, //端口号
RDS_HOST...= '192.168.8.30', //服务器IP 要连接的A服务器redis
RDS_PWD = '123456', //密码
RDS_OPTS = {db:9},...//设置项
client = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS);
//如果需要验证,还要进行验证
//client.auth(password..., callback);
client.auth(RDS_PWD,function(){
console.log('通过认证');
});
// if you'd like to select...);
//可同时获取多个key
client.hmget('hash 1', 'key', 'key2', 'key3', redis.print);
/*两种都可以断掉与redis的连接,
end(