<pre name="code" class="html"><pre name="code" class="html"><pre name="code" class="sql">1.查看安装的redis版本
jrhrpt01:/root# redis-server --version
Redis server v=2.8.19 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=1138bcb7ae3eee58
源码包为redis-2.8.19.tar.gz
2.
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses* libmcrypt* libtool-ltdl-devel* make cmake
3.
demo:/root/redis-2.8.19# make
cd src && make install
make[1]: Entering directory `/root/redis-2.8.19/src'
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/redis-2.8.19/src'
make: *** [install] Error 2
demo:/root/redis-2.8.19#
解决:
make MALLOC=libc
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/root/redis-2.8.19/src'
test-redis2:/root/redis-2.8.19# make install
cd src && make install
make[1]: Entering directory `/root/redis-2.8.19/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/root/redis-2.8.19/src'
4.
安装成功之后会在src文件夹内有redis-server和redis-cli两个命令
建议将其放到bin下
cp redis-server /usr/local/bin/
cp redis-cli /usr/local/bin/
test-redis:/root/redis-2.8.19# cp redis.conf /etc/
5.启动redis
redis-server /etc/redis.conf
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses* libmcrypt* libtool-ltdl-devel* make cmake
23 ls -ltr
24 tar -zxvf redis-2.8.19.tar.gz
25 cd redis-2.8.19
26 make MALLOC=libc
27 cd src
28 ls
29 cp redis-server /usr/local/redis/bin
30 cp redis-cli /usr/local/redis/bin
运行redis:
[root@wx03 ~]# /usr/local/bin/redis-server /etc/redis/redis.conf