centos下手动安装配置redis

Server 林涛 5770℃ 0评论

目标:在centos下手动安装配置redis。

·获取root权限

·进入(或者新建)目录,准备下载

·下载redis:wget http://download.redis.io/releases/redis-2.6.16.tar.gz

·解压redis包:tar zxvf redis-2.6.16.tar.gz

·进入安装目录: cd cd redis-2.6.16

·编译源码:make

·编译时出错:undefined reference to `__sync_add_and_fetch_4' 字样

    因为linux为32位版本(查看方式:getconf LONG_BIT)。

    解决办法:

        执行make命令时加参数:make CFLAGS="-march=i686"

·校验编译是否正确:make test

·如果出现tcl错误:

    出现类似如下的错误提示:You need tcl 8.5 or newer in order to run the Redis test

      则需要安装tcl 8.5 以上版本,直接:yum install tcl 进行安装

·测试redis是否正常运行:

    在当前目录(redis目录)输入启动命令:src/redis-server

·查看进程是否有redis:ps aux | grep redis,可以看见进程列表中有一个叫“src/redis-server”的进程了

·启动redis自带的客户端,进行测试:

        # src/redis-cli — 启动客户端并连接本地Redis
        # set foo bar — 提示 “ok”说明设置键值正常。
        # get foo — 能够提示返回正确的“bar”,说明运行正常。
        # quit — 退出客户端
 
不过我觉得下面这个教程更加 详细:http://blog.csdn.net/chenggong2dm/article/details/6100001

如需转载请注明: 转载自26点的博客

本文链接地址: centos下手动安装配置redis

转载请注明:26点的博客 » centos下手动安装配置redis

喜欢 (0)
发表我的评论
取消评论

表情