1.解压redis
tar xzvf redis-5.0.3.tar.gz
2.进入redis目录
[root@sms1 redis-5.0.3]# make
cd src && make all
make[1]: Entering directory `/usr/local/redis-5.0.3/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/usr/local/redis-5.0.3/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/usr/local/redis-5.0.3/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall -W >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -W -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: Entering directory `/usr/local/redis-5.0.3/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-ldflags)
(echo "" > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/usr/local/redis-5.0.3/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
make[3]: gcc:命令未找到
make[3]: *** [net.o] 错误 127
make[3]: Leaving directory `/usr/local/redis-5.0.3/deps/hiredis'
make[2]: *** [hiredis] 错误 2
make[2]: Leaving directory `/usr/local/redis-5.0.3/deps'
make[1]: [persist-settings] 错误 2 (忽略)
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] 错误 127
make[1]: Leaving directory `/usr/local/redis-5.0.3/src'
make: *** [all] 错误 2
提示gcc和cc命令令未找到
yum -y install gcc gcc-c++ libstdc++-devel
安装后仍然报错
使用
make MALLOC=libc
然后进入src
[root@sms1 src]# make install PREFIX=/apps/SoftWares/redis-5.0.3
3.进入bin目录下启动redis,这样就表示安装成功了。这时候我们并没有指定配置文件,所以使用了默认 的配置文件
[root@sms1 bin]# ./redis-server