Linux 安装部署redis

第一步:下载安装包

  访问https://redis.io/download  到官网进行下载。这里下载最新的4.0版本.
image.png

因为我的安装包redis-5.0.8.tar.gz 在local目录下, 所以这样去操作
解压文件

[root@VM_0_7_centos ~]# cd /usr/local
[root@VM_0_7_centos local]# tar -zxf redis-5.0.8.tar.gz
[root@VM_0_7_centos local]# ls
bin    include  libexec  qcloud              sbin   yd.socket.server
etc    lib      mysql    redis-5.0.8         share
games  lib64    nginx    redis-5.0.8.tar.gz  src

我将redis-5.0.8 命名位redis

[root@VM_0_7_centos local]# ls
bin    include  libexec  qcloud              sbin   yd.socket.server
etc    lib      mysql    redis               share
games  lib64    nginx    redis-5.0.8.tar.gz  src

编译

[root@VM_0_7_centos local]# cd redis/
[root@VM_0_7_centos redis]# make
cd src && make all
make[1]: Entering directory `/usr/local/redis/src'
    CC Makefile.dep
make[1]: Leaving directory `/usr/local/redis/src'
make[1]: Entering directory `/usr/local/redis/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/usr/local/redis/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/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers >> .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 -DREDIS_STATIC='' -Wall -W -Wno-missing-field-initializers -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/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-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/usr/local/redis/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  sds.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  async.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  read.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o read.o
make[3]: Leaving directory `/usr/local/redis/deps/hiredis'
MAKE linenoise
cd linenoise && make
make[3]: Entering directory `/usr/local/redis/deps/linenoise'
cc  -Wall -Os -g  -c linenoise.c
make[3]: Leaving directory `/usr/local/redis/deps/linenoise'
MAKE lua
cd lua/src && make all CFLAGS="-O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' " MYLDFLAGS="" AR="ar rcu"
make[3]: Entering directory `/usr/local/redis/deps/lua/src'
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lapi.o lapi.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lcode.o lcode.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ldebug.o ldebug.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ldo.o ldo.c
ldo.c: In function ‘f_parser’:
ldo.c:496:7: warning: unused variable ‘c’ [-Wunused-variable]
   int c = luaZ_lookahead(p->z);
       ^
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ldump.o ldump.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lfunc.o lfunc.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lgc.o lgc.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o llex.o llex.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lmem.o lmem.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lobject.o lobject.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lopcodes.o lopcodes.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lparser.o lparser.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lstate.o lstate.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lstring.o lstring.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ltable.o ltable.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ltm.o ltm.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lundump.o lundump.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lvm.o lvm.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lzio.o lzio.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o strbuf.o strbuf.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o fpconv.o fpconv.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lauxlib.o lauxlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lbaselib.o lbaselib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ldblib.o ldblib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o liolib.o liolib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lmathlib.o lmathlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o loslib.o loslib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o ltablib.o ltablib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lstrlib.o lstrlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o loadlib.o loadlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o linit.o linit.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lua_cjson.o lua_cjson.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lua_struct.o lua_struct.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lua_cmsgpack.o lua_cmsgpack.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lua_bit.o lua_bit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o strbuf.o fpconv.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o lua_cjson.o lua_struct.o lua_cmsgpack.o lua_bit.o  # DLL needs all object files
ranlib liblua.a
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o lua.o lua.c
cc -o lua  lua.o liblua.a -lm
liblua.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x28c): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o luac.o luac.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC=''    -c -o print.o print.c
cc -o luac  luac.o print.o liblua.a -lm
make[3]: Leaving directory `/usr/local/redis/deps/lua/src'
MAKE jemalloc
cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS=""
configure: WARNING: unrecognized options: --enable-cc-silence
checking for xsltproc... false
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether compiler is cray... no
checking whether compiler supports -std=gnu11... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -Wshorten-64-to-32... no
checking whether compiler supports -Wsign-compare... yes
checking whether compiler supports -Wundef... yes
checking whether compiler supports -Wno-format-zero-length... yes
checking whether compiler supports -pipe... yes
checking whether compiler supports -g3... yes
checking how to run the C preprocessor... gcc -E
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking whether g++ supports C++14 features by default... no
checking whether g++ supports C++14 features with -std=c++14... no
checking whether g++ supports C++14 features with -std=c++0x... no
checking whether g++ supports C++14 features with +std=c++14... no
checking whether g++ supports C++14 features with -h std=c++14... no
configure: No compiler with C++14 support was found
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of intmax_t... 8
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether pause instruction is compilable... yes
checking number of significant virtual address bits... 48
checking for ar... ar
checking for nm... nm
checking for gawk... gawk
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking whether malloc_usable_size definition can use const argument... no
checking for library containing log... -lm
checking whether __attribute__ syntax is compilable... yes
checking whether compiler supports -fvisibility=hidden... yes
checking whether compiler supports -fvisibility=hidden... no
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether tls_model attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether alloc_size attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether format(gnu_printf, ...) attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether format(printf, ...) attribute is compilable... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for ld... /usr/bin/ld
checking for autoconf... false
checking for memalign... yes
checking for valloc... yes
checking whether compiler supports -O3... yes
checking whether compiler supports -O3... no
checking whether compiler supports -funroll-loops... yes
checking configured backtracing method... N/A
checking for sbrk... yes
checking whether utrace(2) is compilable... no
checking whether a program using __builtin_unreachable is compilable... yes
checking whether a program using __builtin_ffsl is compilable... yes
checking LG_PAGE... 12
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlsym... no
checking for dlsym in -ldl... yes
checking whether pthread_atfork(3) is compilable... yes
checking whether pthread_setname_np(3) is compilable... yes
checking for library containing clock_gettime... none required
checking whether clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is compilable... yes
checking whether clock_gettime(CLOCK_MONOTONIC, ...) is compilable... yes
checking whether mach_absolute_time() is compilable... no
checking whether compiler supports -Werror... yes
checking whether syscall(2) is compilable... yes
checking for secure_getenv... yes
checking for sched_getcpu... yes
checking for sched_setaffinity... yes
checking for issetugid... no
checking for _malloc_thread_cleanup... no
checking for _pthread_mutex_init_calloc_cb... no
checking for TLS... yes
checking whether C11 atomics is compilable... no
checking whether GCC __atomic atomics is compilable... yes
checking whether GCC __sync atomics is compilable... yes
checking whether Darwin OSAtomic*() is compilable... no
checking whether madvise(2) is compilable... yes
checking whether madvise(..., MADV_FREE) is compilable... no
checking whether madvise(..., MADV_DONTNEED) is compilable... yes
checking whether madvise(..., MADV_DO[NT]DUMP) is compilable... yes
checking whether madvise(..., MADV_[NO]HUGEPAGE) is compilable... yes
checking whether to force 32-bit __sync_{add,sub}_and_fetch()... no
checking whether to force 64-bit __sync_{add,sub}_and_fetch()... no
checking for __builtin_clz... yes
checking whether Darwin os_unfair_lock_*() is compilable... no
checking whether Darwin OSSpin*() is compilable... no
checking whether glibc malloc hook is compilable... yes
checking whether glibc memalign hook is compilable... yes
checking whether pthreads adaptive mutexes is compilable... yes
checking whether compiler supports -D_GNU_SOURCE... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether strerror_r returns char with gnu source is compilable... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating jemalloc.pc
config.status: creating doc/html.xsl
config.status: creating doc/manpages.xsl
config.status: creating doc/jemalloc.xml
config.status: creating include/jemalloc/jemalloc_macros.h
config.status: creating include/jemalloc/jemalloc_protos.h
config.status: creating include/jemalloc/jemalloc_typedefs.h
config.status: creating include/jemalloc/internal/jemalloc_preamble.h
config.status: creating test/test.sh
config.status: creating test/include/test/jemalloc_test.h
config.status: creating config.stamp
config.status: creating bin/jemalloc-config
config.status: creating bin/jemalloc.sh
config.status: creating bin/jeprof
config.status: creating include/jemalloc/jemalloc_defs.h
config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h
config.status: creating test/include/test/jemalloc_test_defs.h
config.status: executing include/jemalloc/internal/public_symbols.txt commands
config.status: executing include/jemalloc/internal/private_symbols.awk commands
config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands
config.status: executing include/jemalloc/internal/public_namespace.h commands
config.status: executing include/jemalloc/internal/public_unnamespace.h commands
config.status: executing include/jemalloc/internal/size_classes.h commands
config.status: executing include/jemalloc/jemalloc_protos_jet.h commands
config.status: executing include/jemalloc/jemalloc_rename.h commands
config.status: executing include/jemalloc/jemalloc_mangle.h commands
config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands
config.status: executing include/jemalloc/jemalloc.h commands
configure: WARNING: unrecognized options: --enable-cc-silence
===============================================================================
jemalloc version   : 5.1.0-0-g0
library revision   : 2

CONFIG             : --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence 'CFLAGS=-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops ' LDFLAGS=
CC                 : gcc
CONFIGURE_CFLAGS   : -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -fvisibility=hidden -O3 -funroll-loops
SPECIFIED_CFLAGS   : -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops
EXTRA_CFLAGS       :
CPPFLAGS           : -D_GNU_SOURCE -D_REENTRANT
CXX                : g++
CONFIGURE_CXXFLAGS :
SPECIFIED_CXXFLAGS :
EXTRA_CXXFLAGS     :
LDFLAGS            :
EXTRA_LDFLAGS      :
DSO_LDFLAGS        : -shared -Wl,-soname,$(@F)
LIBS               : -lm  -lpthread -ldl
RPATH_EXTRA        :

XSLTPROC           : false
XSLROOT            :

PREFIX             : /usr/local
BINDIR             : /usr/local/bin
DATADIR            : /usr/local/share
INCLUDEDIR         : /usr/local/include
LIBDIR             : /usr/local/lib
MANDIR             : /usr/local/share/man

srcroot            :
abs_srcroot        : /usr/local/redis/deps/jemalloc/
objroot            :
abs_objroot        : /usr/local/redis/deps/jemalloc/

JEMALLOC_PREFIX    : je_
JEMALLOC_PRIVATE_NAMESPACE
                   : je_
install_suffix     :
malloc_conf        :
autogen            : 0
debug              : 0
stats              : 1
prof               : 0
prof-libunwind     : 0
prof-libgcc        : 0
prof-gcc           : 0
fill               : 1
utrace             : 0
xmalloc            : 0
log                : 0
lazy_lock          : 0
cache-oblivious    : 1
cxx                : 0
===============================================================================
cd jemalloc && make CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" lib/libjemalloc.a
make[3]: Entering directory `/usr/local/redis/deps/jemalloc'
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/jemalloc.sym.o src/jemalloc.c
nm -a src/jemalloc.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/jemalloc.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/arena.sym.o src/arena.c
nm -a src/arena.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/arena.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/background_thread.sym.o src/background_thread.c
nm -a src/background_thread.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/background_thread.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/base.sym.o src/base.c
nm -a src/base.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/base.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bin.sym.o src/bin.c
nm -a src/bin.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bin.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bitmap.sym.o src/bitmap.c
nm -a src/bitmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bitmap.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ckh.sym.o src/ckh.c
nm -a src/ckh.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ckh.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ctl.sym.o src/ctl.c
nm -a src/ctl.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ctl.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/div.sym.o src/div.c
nm -a src/div.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/div.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent.sym.o src/extent.c
nm -a src/extent.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_dss.sym.o src/extent_dss.c
nm -a src/extent_dss.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_dss.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_mmap.sym.o src/extent_mmap.c
nm -a src/extent_mmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_mmap.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hash.sym.o src/hash.c
nm -a src/hash.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hash.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hooks.sym.o src/hooks.c
nm -a src/hooks.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hooks.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/large.sym.o src/large.c
nm -a src/large.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/large.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/log.sym.o src/log.c
nm -a src/log.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/log.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/malloc_io.sym.o src/malloc_io.c
nm -a src/malloc_io.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/malloc_io.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex.sym.o src/mutex.c
nm -a src/mutex.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex_pool.sym.o src/mutex_pool.c
nm -a src/mutex_pool.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex_pool.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/nstime.sym.o src/nstime.c
nm -a src/nstime.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/nstime.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/pages.sym.o src/pages.c
nm -a src/pages.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/pages.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prng.sym.o src/prng.c
nm -a src/prng.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prng.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prof.sym.o src/prof.c
nm -a src/prof.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prof.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/rtree.sym.o src/rtree.c
nm -a src/rtree.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/rtree.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/stats.sym.o src/stats.c
nm -a src/stats.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/stats.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/sz.sym.o src/sz.c
nm -a src/sz.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/sz.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tcache.sym.o src/tcache.c
nm -a src/tcache.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tcache.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ticker.sym.o src/ticker.c
nm -a src/ticker.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ticker.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tsd.sym.o src/tsd.c
nm -a src/tsd.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tsd.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/witness.sym.o src/witness.c
nm -a src/witness.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/witness.sym
/bin/sh include/jemalloc/internal/private_namespace.sh src/jemalloc.sym src/arena.sym src/background_thread.sym src/base.sym src/bin.sym src/bitmap.sym src/ckh.sym src/ctl.sym src/div.sym src/extent.sym src/extent_dss.sym src/extent_mmap.sym src/hash.sym src/hooks.sym src/large.sym src/log.sym src/malloc_io.sym src/mutex.sym src/mutex_pool.sym src/nstime.sym src/pages.sym src/prng.sym src/prof.sym src/rtree.sym src/stats.sym src/sz.sym src/tcache.sym src/ticker.sym src/tsd.sym src/witness.sym > include/jemalloc/internal/private_namespace.gen.h
cp include/jemalloc/internal/private_namespace.gen.h include/jemalloc/internal/private_namespace.gen.h
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/background_thread.o src/background_thread.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bin.o src/bin.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/div.o src/div.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_dss.o src/extent_dss.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_mmap.o src/extent_mmap.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hooks.o src/hooks.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/large.o src/large.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/log.o src/log.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/malloc_io.o src/malloc_io.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex_pool.o src/mutex_pool.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/nstime.o src/nstime.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/pages.o src/pages.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prng.o src/prng.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/sz.o src/sz.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ticker.o src/ticker.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tsd.o src/tsd.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops  -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/witness.o src/witness.c
ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/background_thread.o src/base.o src/bin.o src/bitmap.o src/ckh.o src/ctl.o src/div.o src/extent.o src/extent_dss.o src/extent_mmap.o src/hash.o src/hooks.o src/large.o src/log.o src/malloc_io.o src/mutex.o src/mutex_pool.o src/nstime.o src/pages.o src/prng.o src/prof.o src/rtree.o src/stats.o src/sz.o src/tcache.o src/ticker.o src/tsd.o src/witness.o
make[3]: Leaving directory `/usr/local/redis/deps/jemalloc'
make[2]: Leaving directory `/usr/local/redis/deps'
    CC adlist.o
    CC quicklist.o
    CC ae.o
    CC anet.o
    CC dict.o
    CC server.o
    CC sds.o
    CC zmalloc.o
    CC lzf_c.o
    CC lzf_d.o
    CC pqsort.o
    CC zipmap.o
    CC sha1.o
    CC ziplist.o
    CC release.o
    CC networking.o
    CC util.o
    CC object.o
    CC db.o
    CC replication.o
    CC rdb.o
    CC t_string.o
    CC t_list.o
    CC t_set.o
    CC t_zset.o
    CC t_hash.o
    CC config.o
    CC aof.o
    CC pubsub.o
    CC multi.o
    CC debug.o
    CC sort.o
    CC intset.o
    CC syncio.o
    CC cluster.o
    CC crc16.o
    CC endianconv.o
    CC slowlog.o
    CC scripting.o
    CC bio.o
    CC rio.o
    CC rand.o
    CC memtest.o
    CC crc64.o
    CC bitops.o
    CC sentinel.o
    CC notify.o
    CC setproctitle.o
    CC blocked.o
    CC hyperloglog.o
    CC latency.o
    CC sparkline.o
    CC redis-check-rdb.o
    CC redis-check-aof.o
    CC geo.o
    CC lazyfree.o
    CC module.o
    CC evict.o
    CC expire.o
    CC geohash.o
    CC geohash_helper.o
    CC childinfo.o
    CC defrag.o
    CC siphash.o
    CC rax.o
    CC t_stream.o
    CC listpack.o
    CC localtime.o
    CC lolwut.o
    CC lolwut5.o
    LINK redis-server
    INSTALL redis-sentinel
    CC redis-cli.o
    LINK redis-cli
    CC redis-benchmark.o
    LINK redis-benchmark
    INSTALL redis-check-rdb
    INSTALL redis-check-aof

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/usr/local/redis/src'

编译完成之后,可以看到解压文件redis-3.0.7 中会有对应的src、conf等文件夹

[root@VM_0_7_centos redis]# cd src
[root@VM_0_7_centos src]# cd ..
[root@VM_0_7_centos redis]# ll
total 276
-rw-rw-r--  1 root root 118338 Mar 12 23:07 00-RELEASENOTES
-rw-rw-r--  1 root root     53 Mar 12 23:07 BUGS
-rw-rw-r--  1 root root   2381 Mar 12 23:07 CONTRIBUTING
-rw-rw-r--  1 root root   1487 Mar 12 23:07 COPYING
drwxrwxr-x  6 root root   4096 Mar 22 17:33 deps
-rw-rw-r--  1 root root     11 Mar 12 23:07 INSTALL
-rw-rw-r--  1 root root    151 Mar 12 23:07 Makefile
-rw-rw-r--  1 root root   6888 Mar 12 23:07 MANIFESTO
-rw-rw-r--  1 root root  20555 Mar 12 23:07 README.md
-rw-rw-r--  1 root root  61797 Mar 12 23:07 redis.conf
-rwxrwxr-x  1 root root    275 Mar 12 23:07 runtest
-rwxrwxr-x  1 root root    280 Mar 12 23:07 runtest-cluster
-rwxrwxr-x  1 root root    373 Mar 12 23:07 runtest-moduleapi
-rwxrwxr-x  1 root root    281 Mar 12 23:07 runtest-sentinel
-rw-rw-r--  1 root root   9710 Mar 12 23:07 sentinel.conf
drwxrwxr-x  3 root root   4096 Mar 22 17:35 src
drwxrwxr-x 11 root root   4096 Mar 12 23:07 tests
drwxrwxr-x  8 root root   4096 Mar 12 23:07 utils

编译成功后,进入src文件夹,执行make install进行Redis安装。

[root@VM_0_7_centos redis]# cd src
[root@VM_0_7_centos src]# make install
    CC Makefile.dep

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
[root@VM_0_7_centos src]# ll
total 52460
-rw-rw-r-- 1 root root   10291 Mar 12 23:07 adlist.c
-rw-rw-r-- 1 root root    3512 Mar 12 23:07 adlist.h
-rw-r--r-- 1 root root   18208 Mar 22 17:34 adlist.o
-rw-rw-r-- 1 root root   17645 Mar 12 23:07 ae.c
-rw-rw-r-- 1 root root    4846 Mar 12 23:07 ae_epoll.c
-rw-rw-r-- 1 root root   10939 Mar 12 23:07 ae_evport.c
-rw-rw-r-- 1 root root    5338 Mar 12 23:07 ae.h
-rw-rw-r-- 1 root root    4567 Mar 12 23:07 ae_kqueue.c
-rw-r--r-- 1 root root   38208 Mar 22 17:34 ae.o
-rw-rw-r-- 1 root root    3828 Mar 12 23:07 ae_select.c
-rw-rw-r-- 1 root root   20701 Mar 12 23:07 anet.c
-rw-rw-r-- 1 root root    3562 Mar 12 23:07 anet.h
-rw-r--r-- 1 root root   66016 Mar 22 17:34 anet.o
-rw-rw-r-- 1 root root   72462 Mar 12 23:07 aof.c
-rw-r--r-- 1 root root  201088 Mar 22 17:34 aof.o
-rw-rw-r-- 1 root root    2833 Mar 12 23:07 asciilogo.h
-rw-rw-r-- 1 root root    5367 Mar 12 23:07 atomicvar.h
-rw-rw-r-- 1 root root   10825 Mar 12 23:07 bio.c
-rw-rw-r-- 1 root root    2120 Mar 12 23:07 bio.h
-rw-r--r-- 1 root root   25640 Mar 22 17:34 bio.o
-rw-rw-r-- 1 root root   41585 Mar 12 23:07 bitops.c
-rw-r--r-- 1 root root  105144 Mar 22 17:34 bitops.o
-rw-rw-r-- 1 root root   27545 Mar 12 23:07 blocked.c
-rw-r--r-- 1 root root   72976 Mar 22 17:34 blocked.o
-rw-rw-r-- 1 root root    3834 Mar 12 23:07 childinfo.c
-rw-r--r-- 1 root root   37912 Mar 22 17:34 childinfo.o
-rw-rw-r-- 1 root root  228906 Mar 12 23:07 cluster.c
-rw-rw-r-- 1 root root   14406 Mar 12 23:07 cluster.h
-rw-r--r-- 1 root root  388584 Mar 22 17:34 cluster.o
-rw-rw-r-- 1 root root  103441 Mar 12 23:07 config.c
-rw-rw-r-- 1 root root    7138 Mar 12 23:07 config.h
-rw-r--r-- 1 root root  311088 Mar 22 17:34 config.o
-rw-rw-r-- 1 root root    4477 Mar 12 23:07 crc16.c
-rw-r--r-- 1 root root    6760 Mar 22 17:34 crc16.o
-rw-rw-r-- 1 root root   10717 Mar 12 23:07 crc64.c
-rw-rw-r-- 1 root root     193 Mar 12 23:07 crc64.h
-rw-r--r-- 1 root root    6312 Mar 22 17:34 crc64.o
-rw-rw-r-- 1 root root   54398 Mar 12 23:07 db.c
-rw-r--r-- 1 root root  169680 Mar 22 17:34 db.o
-rw-rw-r-- 1 root root   55015 Mar 12 23:07 debug.c
-rw-rw-r-- 1 root root    2356 Mar 12 23:07 debugmacro.h
-rw-r--r-- 1 root root  218408 Mar 22 17:34 debug.o
-rw-rw-r-- 1 root root   43054 Mar 12 23:07 defrag.c
-rw-r--r-- 1 root root  116968 Mar 22 17:34 defrag.o
-rw-rw-r-- 1 root root   40843 Mar 12 23:07 dict.c
-rw-rw-r-- 1 root root    7268 Mar 12 23:07 dict.h
-rw-r--r-- 1 root root   59744 Mar 22 17:34 dict.o
-rw-rw-r-- 1 root root    3777 Mar 12 23:07 endianconv.c
-rw-rw-r-- 1 root root    2937 Mar 12 23:07 endianconv.h
-rw-r--r-- 1 root root    5496 Mar 22 17:34 endianconv.o
-rw-rw-r-- 1 root root   26955 Mar 12 23:07 evict.c
-rw-r--r-- 1 root root   65208 Mar 22 17:34 evict.o
-rw-rw-r-- 1 root root   21141 Mar 12 23:07 expire.c
-rw-r--r-- 1 root root   66304 Mar 22 17:34 expire.o
-rw-rw-r-- 1 root root    2147 Mar 12 23:07 fmacros.h
-rw-rw-r-- 1 root root   29977 Mar 12 23:07 geo.c
-rw-rw-r-- 1 root root     405 Mar 12 23:07 geo.h
-rw-rw-r-- 1 root root   10015 Mar 12 23:07 geohash.c
-rw-rw-r-- 1 root root    4124 Mar 12 23:07 geohash.h
-rw-rw-r-- 1 root root    9411 Mar 12 23:07 geohash_helper.c
-rw-rw-r-- 1 root root    3350 Mar 12 23:07 geohash_helper.h
-rw-r--r-- 1 root root   22800 Mar 22 17:34 geohash_helper.o
-rw-r--r-- 1 root root   29248 Mar 22 17:34 geohash.o
-rw-r--r-- 1 root root  101696 Mar 22 17:34 geo.o
-rw-rw-r-- 1 root root   29486 Mar 12 23:07 help.h
-rw-rw-r-- 1 root root   58207 Mar 12 23:07 hyperloglog.c
-rw-r--r-- 1 root root  112856 Mar 22 17:34 hyperloglog.o
-rw-rw-r-- 1 root root   16240 Mar 12 23:07 intset.c
-rw-rw-r-- 1 root root    2302 Mar 12 23:07 intset.h
-rw-r--r-- 1 root root   27320 Mar 22 17:34 intset.o
-rw-rw-r-- 1 root root   27415 Mar 12 23:07 latency.c
-rw-rw-r-- 1 root root    3914 Mar 12 23:07 latency.h
-rw-r--r-- 1 root root   85032 Mar 22 17:34 latency.o
-rw-rw-r-- 1 root root    5921 Mar 12 23:07 lazyfree.c
-rw-r--r-- 1 root root   47848 Mar 22 17:34 lazyfree.o
-rw-rw-r-- 1 root root   30546 Mar 12 23:07 listpack.c
-rw-rw-r-- 1 root root    2786 Mar 12 23:07 listpack.h
-rw-rw-r-- 1 root root    2144 Mar 12 23:07 listpack_malloc.h
-rw-r--r-- 1 root root   33016 Mar 22 17:34 listpack.o
-rw-rw-r-- 1 root root    5676 Mar 12 23:07 localtime.c
-rw-r--r-- 1 root root    6960 Mar 22 17:34 localtime.o
-rw-rw-r-- 1 root root   11225 Mar 12 23:07 lolwut5.c
-rw-r--r-- 1 root root   33728 Mar 22 17:34 lolwut5.o
-rw-rw-r-- 1 root root    2487 Mar 12 23:07 lolwut.c
-rw-r--r-- 1 root root   14728 Mar 22 17:34 lolwut.o
-rw-rw-r-- 1 root root    9012 Mar 12 23:07 lzf_c.c
-rw-r--r-- 1 root root    9392 Mar 22 17:34 lzf_c.o
-rw-rw-r-- 1 root root    6450 Mar 12 23:07 lzf_d.c
-rw-r--r-- 1 root root   11864 Mar 22 17:34 lzf_d.o
-rw-rw-r-- 1 root root    4407 Mar 12 23:07 lzf.h
-rw-rw-r-- 1 root root    5874 Mar 12 23:07 lzfP.h
-rw-rw-r-- 1 root root    9876 Mar 12 23:07 Makefile
-rw-r--r-- 1 root root   18147 Mar 22 17:35 Makefile.dep
-rw-rw-r-- 1 root root   13441 Mar 12 23:07 memtest.c
-rw-r--r-- 1 root root   35776 Mar 22 17:34 memtest.o
-rwxrwxr-x 1 root root     735 Mar 12 23:07 mkreleasehdr.sh
-rw-rw-r-- 1 root root  224476 Mar 12 23:07 module.c
-rw-r--r-- 1 root root  422832 Mar 22 17:34 module.o
drwxrwxr-x 2 root root    4096 Mar 12 23:07 modules
-rw-rw-r-- 1 root root   12736 Mar 12 23:07 multi.c
-rw-r--r-- 1 root root   58288 Mar 22 17:34 multi.o
-rw-rw-r-- 1 root root   87721 Mar 12 23:07 networking.c
-rw-r--r-- 1 root root  205864 Mar 22 17:34 networking.o
-rw-rw-r-- 1 root root    5855 Mar 12 23:07 notify.c
-rw-r--r-- 1 root root   46776 Mar 22 17:34 notify.o
-rw-rw-r-- 1 root root   56238 Mar 12 23:07 object.c
-rw-r--r-- 1 root root  170080 Mar 22 17:34 object.o
-rw-rw-r-- 1 root root    5528 Mar 12 23:07 pqsort.c
-rw-rw-r-- 1 root root    1964 Mar 12 23:07 pqsort.h
-rw-r--r-- 1 root root   31400 Mar 22 17:34 pqsort.o
-rw-rw-r-- 1 root root   13296 Mar 12 23:07 pubsub.c
-rw-r--r-- 1 root root   72944 Mar 22 17:34 pubsub.o
-rw-rw-r-- 1 root root  100445 Mar 12 23:07 quicklist.c
-rw-rw-r-- 1 root root    7815 Mar 12 23:07 quicklist.h
-rw-r--r-- 1 root root   75568 Mar 22 17:34 quicklist.o
-rw-rw-r-- 1 root root    3848 Mar 12 23:07 rand.c
-rw-rw-r-- 1 root root    1763 Mar 12 23:07 rand.h
-rw-r--r-- 1 root root    6960 Mar 22 17:34 rand.o
-rw-rw-r-- 1 root root   76311 Mar 12 23:07 rax.c
-rw-rw-r-- 1 root root    9620 Mar 12 23:07 rax.h
-rw-rw-r-- 1 root root    2082 Mar 12 23:07 rax_malloc.h
-rw-r--r-- 1 root root  106920 Mar 22 17:34 rax.o
-rw-rw-r-- 1 root root   98032 Mar 12 23:07 rdb.c
-rw-rw-r-- 1 root root    7245 Mar 12 23:07 rdb.h
-rw-r--r-- 1 root root  305880 Mar 22 17:34 rdb.o
-rw-rw-r-- 1 root root    2418 Mar 12 23:07 redisassert.h
-rwxr-xr-x 1 root root 4367624 Mar 22 17:35 redis-benchmark
-rw-rw-r-- 1 root root   29605 Mar 12 23:07 redis-benchmark.c
-rw-r--r-- 1 root root  109152 Mar 22 17:35 redis-benchmark.o
-rwxr-xr-x 1 root root 8127056 Mar 22 17:35 redis-check-aof
-rw-rw-r-- 1 root root    7175 Mar 12 23:07 redis-check-aof.c
-rw-r--r-- 1 root root   28776 Mar 22 17:34 redis-check-aof.o
-rwxr-xr-x 1 root root 8127056 Mar 22 17:35 redis-check-rdb
-rw-rw-r-- 1 root root   13545 Mar 12 23:07 redis-check-rdb.c
-rw-r--r-- 1 root root   66120 Mar 22 17:34 redis-check-rdb.o
-rwxr-xr-x 1 root root 4808720 Mar 22 17:35 redis-cli
-rw-rw-r-- 1 root root  267061 Mar 12 23:07 redis-cli.c
-rw-r--r-- 1 root root  931672 Mar 22 17:35 redis-cli.o
-rw-rw-r-- 1 root root   32590 Mar 12 23:07 redismodule.h
-rwxr-xr-x 1 root root 8127056 Mar 22 17:34 redis-sentinel
-rwxr-xr-x 1 root root 8127056 Mar 22 17:34 redis-server
-rwxrwxr-x 1 root root    3600 Mar 12 23:07 redis-trib.rb
-rw-rw-r-- 1 root root    2163 Mar 22 17:33 release.c
-rw-r--r-- 1 root root     112 Mar 22 17:33 release.h
-rw-r--r-- 1 root root    4288 Mar 22 17:34 release.o
-rw-rw-r-- 1 root root  114383 Mar 12 23:07 replication.c
-rw-r--r-- 1 root root  200000 Mar 22 17:34 replication.o
-rw-rw-r-- 1 root root   12107 Mar 12 23:07 rio.c
-rw-rw-r-- 1 root root    5369 Mar 12 23:07 rio.h
-rw-r--r-- 1 root root   31320 Mar 22 17:34 rio.o
-rw-rw-r-- 1 root root   89736 Mar 12 23:07 scripting.c
-rw-r--r-- 1 root root  267752 Mar 22 17:34 scripting.o
-rw-rw-r-- 1 root root    2083 Mar 12 23:07 sdsalloc.h
-rw-rw-r-- 1 root root   40753 Mar 12 23:07 sds.c
-rw-rw-r-- 1 root root    8981 Mar 12 23:07 sds.h
-rw-r--r-- 1 root root  109096 Mar 22 17:34 sds.o
-rw-rw-r-- 1 root root  177870 Mar 12 23:07 sentinel.c
-rw-r--r-- 1 root root  338856 Mar 22 17:34 sentinel.o
-rw-rw-r-- 1 root root  171143 Mar 12 23:07 server.c
-rw-rw-r-- 1 root root   99061 Mar 12 23:07 server.h
-rw-r--r-- 1 root root  460368 Mar 22 17:34 server.o
-rw-rw-r-- 1 root root    5728 Mar 12 23:07 setproctitle.c
-rw-r--r-- 1 root root   15528 Mar 22 17:34 setproctitle.o
-rw-rw-r-- 1 root root    7252 Mar 12 23:07 sha1.c
-rw-rw-r-- 1 root root     566 Mar 12 23:07 sha1.h
-rw-r--r-- 1 root root   21208 Mar 22 17:34 sha1.o
-rw-rw-r-- 1 root root   14037 Mar 12 23:07 siphash.c
-rw-r--r-- 1 root root   14544 Mar 22 17:34 siphash.o
-rw-rw-r-- 1 root root    7940 Mar 12 23:07 slowlog.c
-rw-rw-r-- 1 root root    2306 Mar 12 23:07 slowlog.h
-rw-r--r-- 1 root root   55792 Mar 22 17:34 slowlog.o
-rw-rw-r-- 1 root root    2201 Mar 12 23:07 solarisfixes.h
-rw-rw-r-- 1 root root   22362 Mar 12 23:07 sort.c
-rw-r--r-- 1 root root   84856 Mar 22 17:34 sort.o
-rw-rw-r-- 1 root root    6588 Mar 12 23:07 sparkline.c
-rw-rw-r-- 1 root root    2345 Mar 12 23:07 sparkline.h
-rw-r--r-- 1 root root   17552 Mar 22 17:34 sparkline.o
-rw-rw-r-- 1 root root    5973 Mar 12 23:07 stream.h
-rw-rw-r-- 1 root root    5580 Mar 12 23:07 syncio.c
-rw-r--r-- 1 root root   13136 Mar 22 17:34 syncio.o
-rw-rw-r-- 1 root root    2431 Mar 12 23:07 testhelp.h
-rw-rw-r-- 1 root root   26994 Mar 12 23:07 t_hash.c
-rw-r--r-- 1 root root  123208 Mar 22 17:34 t_hash.o
-rw-rw-r-- 1 root root   26414 Mar 12 23:07 t_list.c
-rw-r--r-- 1 root root  108584 Mar 22 17:34 t_list.o
-rw-rw-r-- 1 root root   38937 Mar 12 23:07 t_set.c
-rw-r--r-- 1 root root  122048 Mar 22 17:34 t_set.o
-rw-rw-r-- 1 root root  104938 Mar 12 23:07 t_stream.c
-rw-r--r-- 1 root root  227128 Mar 22 17:34 t_stream.o
-rw-rw-r-- 1 root root   15192 Mar 12 23:07 t_string.c
-rw-r--r-- 1 root root   81592 Mar 22 17:34 t_string.o
-rw-rw-r-- 1 root root  108437 Mar 12 23:07 t_zset.c
-rw-r--r-- 1 root root  395304 Mar 22 17:34 t_zset.o
-rw-rw-r-- 1 root root   26787 Mar 12 23:07 util.c
-rw-rw-r-- 1 root root    2726 Mar 12 23:07 util.h
-rw-r--r-- 1 root root   46568 Mar 22 17:34 util.o
-rw-rw-r-- 1 root root     225 Mar 12 23:07 valgrind.sup
-rw-rw-r-- 1 root root      30 Mar 12 23:07 version.h
-rw-rw-r-- 1 root root   70258 Mar 12 23:07 ziplist.c
-rw-rw-r-- 1 root root    2927 Mar 12 23:07 ziplist.h
-rw-r--r-- 1 root root   61232 Mar 22 17:34 ziplist.o
-rw-rw-r-- 1 root root   16870 Mar 12 23:07 zipmap.c
-rw-rw-r-- 1 root root    2651 Mar 12 23:07 zipmap.h
-rw-r--r-- 1 root root   28720 Mar 22 17:34 zipmap.o
-rw-rw-r-- 1 root root   14550 Mar 12 23:07 zmalloc.c
-rw-rw-r-- 1 root root    4079 Mar 12 23:07 zmalloc.h
-rw-r--r-- 1 root root   37128 Mar 22 17:34 zmalloc.o

部署 为了方便管理,将Redis文件中的conf配置文件和常用命令移动到统一文件中
创建bin和etc文件

  1. 回到刚刚安装目录,找到redis.conf,将其复制移动到 /usr/local/redis/etc 下
  2. 进入src目录,移动mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server到/usr/local/redis/bin/
[root@VM_0_7_centos src]# cd ..
[root@VM_0_7_centos redis]# mkdir etc
[root@VM_0_7_centos redis]# mkdir bin
[root@VM_0_7_centos redis]# mv redis.conf /usr/local/redis/etc/
[root@VM_0_7_centos redis]# cd src
[root@VM_0_7_centos src]# mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server /usr/local/redis/bin/

依次查看移动后文件

[root@VM_0_7_centos src]# cd ..
[root@VM_0_7_centos redis]# cd bin
[root@VM_0_7_centos bin]# ls
mkreleasehdr.sh  redis-check-aof  redis-cli
redis-benchmark  redis-check-rdb  redis-server
[root@VM_0_7_centos bin]# cd ..
[root@VM_0_7_centos redis]# cd ect/
-bash: cd: ect/: No such file or directory
[root@VM_0_7_centos redis]# cd etc
[root@VM_0_7_centos etc]# ls
redis.conf

执行redis-server 启动redis

[root@VM_0_7_centos etc]# cd ..
[root@VM_0_7_centos redis]# cd bin/
[root@VM_0_7_centos bin]# ./redis-server
32252:C 22 Mar 2020 17:39:18.034 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
32252:C 22 Mar 2020 17:39:18.034 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=32252, just started
32252:C 22 Mar 2020 17:39:18.034 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 5.0.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 32252
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

32252:M 22 Mar 2020 17:39:18.036 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
32252:M 22 Mar 2020 17:39:18.036 # Server initialized
32252:M 22 Mar 2020 17:39:18.036 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
32252:M 22 Mar 2020 17:39:18.036 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
32252:M 22 Mar 2020 17:39:18.036 * Ready to accept connections
^C32252:signal-handler (1584869993) Received SIGINT scheduling shutdown...
32252:M 22 Mar 2020 17:39:53.712 # User requested shutdown...
32252:M 22 Mar 2020 17:39:53.712 * Saving the final RDB snapshot before exiting.
32252:M 22 Mar 2020 17:39:53.718 * DB saved on disk
32252:M 22 Mar 2020 17:39:53.718 # Redis is now ready to exit, bye bye...

设置绑定ip(注:该步骤如果不需要可省略)

[root@VM_0_7_centos bin]# cd ..
[root@VM_0_7_centos redis]# cd etc
[root@VM_0_7_centos etc]# vim redis.conf
image.png

设置后台启动redis
将no修改为yes

cd etc/
vim redis.conf
image.png

再次启动redis服务,并指定启动服务配置文件

[root@VM_0_7_centos etc]# cd ..
[root@VM_0_7_centos redis]# cd bin
[root@VM_0_7_centos bin]# ./redis-server /usr/local/redis/etc/redis.conf
32575:C 22 Mar 2020 17:41:50.795 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
32575:C 22 Mar 2020 17:41:50.795 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=32575, just started
32575:C 22 Mar 2020 17:41:50.795 # Configuration loaded

链接客户端

[root@VM_0_7_centos bin]# ./redis-cli
127.0.0.1:6379> exit

查看进程

[root@VM_0_7_centos bin]# netstat -tunpl|grep 6379
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      32576/./redis-serve
[root@VM_0_7_centos bin]# 

配置后台运行成功。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,772评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,458评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,610评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,640评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,657评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,590评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,962评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,631评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,870评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,611评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,704评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,386评论 4 319
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,969评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,944评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,179评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,742评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,440评论 2 342

推荐阅读更多精彩内容