码迷,mamicode.com
首页 > 其他好文 > 详细

redis安装

时间:2016-04-30 15:33:01      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

//redis安装
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget wget https://codeload.github.com/antirez/redis/tar.gz/2.8.21 -O redis-2.8.21.tar.gz
[root@localhost src]# tar zxvf redis-2.8.21.tar.gz
[root@localhost src]# cd  redis-2.8.21
[root@localhost redis-2.8.21]#  make   //与memcache一样不需要./configure
...
...
Hint: Its a good idea to run make test ;)    //成功

//要加上安装路径
[root@localhost redis-2.8.21]# make PREFIX=/usr/local/redis intsall

//创建配置目录
[root@localhost redis-2.8.21]# mkdir /usr/local/redis/etc

//下载配置文件
[root@localhost redis-2.8.21]# wget http://www.apelearn.com/study_v2/.redis_conf -O /usr/local/redis/etc/redis.conf 2>/dev/null

//下载启动脚本
[root@localhost redis-2.8.21]# wget http://www.apelearn.com/study_v2/.redis_init -O /etc/init.d/redis 2>/dev/null

[root@localhost redis-2.8.21]# useradd -s /sbin/nologin redis
[root@localhost redis-2.8.21]# mkdir /usr/local/redis/var
[root@localhost redis-2.8.21]# chmod 777 /usr/local/redis/var/
[root@localhost redis-2.8.21]# chmod 755 /etc/init.d/redis
[root@localhost redis-2.8.21]# chkconfig --add redis
[root@localhost redis-2.8.21]# chkconfig redis on
[root@localhost redis-2.8.21]# service redis start
启动 :                                                    [确定]

 

 

安装redis会遇到的错误:

1. make[3]:gcc: 命令未找到

--> yum install -y gcc


2. 错误: jamalloc/jamalloc.h: 没有那个文件或目录
    
--> yum install -y jamalloc-devel

--> 需要安装扩展源 yum install -y epel-release


3. cc: ../deps/hiredis/libhiredis.a: 没有那个文件或目录
    cc: ../deps/lua/src/liblua.a: 没有那个文件或目录
    cc: ../deps/jemalloc/lib/libjemalloc.a: 没有那个文件或目录

--> 
[root@localhost redis-2.8.21]# cd deps/
[root@localhost deps]# make hiredis lua jemalloc
[root@localhost deps]# cd redis-2.8.21
[root@localhost redis-2.8.21]# make


4.     cc: ../deps/linenoise/linenoise.o: 没有那个文件或目录

--> 
[root@localhost redis-2.8.21]# cd deps/
[root@localhost deps]# make linenoise
[root@localhost deps]# cd redis-2.8.21
[root@localhost redis-2.8.21]# make

 

redis安装

标签:

原文地址:http://www.cnblogs.com/frankielf0921/p/5448744.html

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