【redis】之centos6.x安装redis3.0.x

centos6.9_x86_64

1、下载redis安装包

http://download.redis.io/releases/redis-3.2.9.tar.gz

2、解压

编译到指定得目录

make PREFIX=/usr/local/redis install 

tar -zxvf redis-3.2.9.tar.gz 
cd redis-3.2.9
make && make install

如果你make时候出错,redis出现问题zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录

请执行

make MALLOC=libc
在编译redis3.2.9时报错

cc: ../deps/hiredis/libhiredis.a: No such file or directory
cc: ../deps/lua/src/liblua.a: No such file or directory
cc: ../deps/geohash-int/geohash.o: No such file or directory
cc: ../deps/geohash-int/geohash_helper.o: No such file or directory
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/usr/local/src/redis-3.2.9/src'
make: *** [all] Error 2
进入源码包目录下的deps目录中执行

make geohash-int hiredis jemalloc linenoise lua

然后在执行make  && make install  即可

   

新建redis文件在

mkdir -p /usr/redis

 将需要的几个redis文件全部拷贝到这里,这几个文件可能在redis源文件的src下

cp redis-server /usr/redis

cp redis-benchmark /usr/redis

cp redis-cli /usr/redis

cp redis.conf /usr/redis

cd /usr/redis

 测试redis是否安装成功

./redis-server redis.conf

 需要将redis.conf文件的daemonize改为yes,后台启动

 

[root@localhost redis]# ./redis-server redis.conf 
[root@localhost redis]# ./redis-cli 
127.0.0.1:6379> 

 

 ok

 redis配置文件详解

https://www.cnblogs.com/kreo/p/4423362.html

redis连接过多

http://blog.csdn.net/cxhgg/article/details/67640263

原文地址:https://www.cnblogs.com/gyjx2016/p/7204603.html