CentOS 5.10 32位下安装配置redis

来源:互联网 发布:淘宝挖宝酱 假货 编辑:程序博客网 时间:2024/06/05 03:37

本来想整点游戏,但是工作一直在做hybrid。

忙是一个借口,昨天白天是睡过去的,在连续奋战22个小时上线生产后,虽然又发现了新问题——越狱版苹果4s下拉刷新又有bug。但是也仅仅是发现了一台会出现这个问题,希望天亮能翻开这一页,毕竟新需求眼瞅又得开始编码了,预计12底上线的活动,这几天我一直都在关注大家的白头发。

个人博客整了许久,express3加mongodb打造的,虽然上线了,但是很多功能没有完善,最近想统计访问量决定用redis打造。

putty进入我的云服务器

到http://download.redis.io/releases/可以找到各种版本的redis

# wget http://download.redis.io/releases/redis-2.6.14.tar.gz

解压

tar zxvf redis-2.6.14.tar.gz

进入解压目录 安装

 cd redis-2.6.14

make
zmalloc.o: In function `zmalloc_used_memory':/usr/local/src/redis-2.6.14/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'collect2: ld returned 1 exit statusmake[1]: *** [redis-server] Error 1make[1]: Leaving directory `/usr/local/src/redis-2.6.14/src'make: *** [all] Error 2

报错了:

网上查了一下,因为的我的系统是32位的,所以得在make后加 FLAGS="-march=i686"

make CFLAGS="-march=i686"

安装没有再上面的问题

make install <span style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; line-height: 18px; background-color: rgb(250, 250, 250);">安装会把redis的命令被拷贝到/usr/local/bin下面</span>

提示 

cd src && make install

执行这步后提示To run 'make test' is a good idea ;) 对于这一步的test ————测试用例,非必选,可以跳过。

make test
 

居然提示You need tcl 8.5 or newer in order to run the Redis test

网上找tcl8.5安装


wget http://downloads.sourceforge.net/tcl/tcl8.5.10-src.tar.gztar xzvf tcl8.5.10-src.tar.gz<pre name="code" class="plain">cd tcl8.5.10/unix/
./configuremakemake install

安装成功后,回到 目录,继续执行 make test,卡在

[30/32 done]: unit/sort (72 seconds)[ok]: Client output buffer soft limit is enforced if time is overreached[31/32 done]: unit/obuf-limits (40 seconds)

ctrl+c强制停止,再试了几次,卡得不耐烦后,终于出现

\o/ All tests passed without errors!Cleanup: may take some time... OK


redis用例测试成功


在启动redis前,回到上一级目录,编辑redis.conf,修改配置

vim redis.conf 

把daemonize no 改成 daemonize yes,这样启动redis时就会成会后台服务

把#bind 127.0.0.1 改成 bind 127.0.0.1 

这样远程就不能访问,安全性考虑,当然还可以配置端口,密码等。

然后进入/usr/local/src/redis-2.6.14/src目录 启动

[root@iZ28jgc6wlbZ src]# ./redis-server ./../redis.conf[root@iZ28jgc6wlbZ src]# grep redis[root@iZ28jgc6wlbZ src]# redis-cliredis 127.0.0.1:6379> set hello worldOKredis 127.0.0.1:6379> get hello"world"redis 127.0.0.1:6379>

redis安装 并且操作成功。


相关参考:

http://blog.csdn.net/luyee2010/article/details/18766911


http://blog.csdn.net/molaifeng/article/details/9149551


http://www.cnblogs.com/nexiyi/p/3454898.html


http://www.92csz.com/18/1231.html


http://www.linuxidc.com/Linux/2012-12/75314.htm


http://www.oschina.net/question/585454_128729


http://www.server110.com/database/201309/1478.html


http://www.2cto.com/Article/201403/287017.html


http://blog.csdn.net/pb09013037/article/details/28984239


http://blog.csdn.net/chenggong2dm/article/details/6100001

http://chenzehe.iteye.com/blog/1407846


http://linux.chinaunix.net/techdoc/beginner/2009/12/20/1150108.shtml

0 0
原创粉丝点击