nodejs redis

 

1.node command example

> var _redis = require("redis")
undefined
> var redis = _redis.createClient({auth_pass :"123456"});  //auth to redis with password 1234
undefined
> redis.set("name","ydev")
true
> redis.get("name")
true

 

2. config and startup redis

setup redis: config password, maxhead and maxmemory;note it the maxmemory must be larger than maxheap

 

requirepass 123456

maxheap 10240000
maxmemory 20480000

 

start up redis with configfile:

redis-server redis.conf

 

 

http://www.nodejs.net/a/20130128/105909.html

https://www.npmjs.com/package/redis

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。