码迷,mamicode.com
首页 > Web开发 > 详细

nodejs redis

时间:2014-12-28 12:51:30      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

 

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

 

nodejs redis

标签:

原文地址:http://www.cnblogs.com/zyip/p/4189786.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!