学习笔记0714----NOSQL之redis

redis

  • 1. redis介绍
  • 2. redis安装
    • 2.1 下载redis
    • 2.2 解压redis
    • 2.3 安装redis
    • 2.4 复制配置文件
    • 2.5 启动redis
    • 2.6 查看redis日志
    • 2.6 修改内核参数
  • 3. redis持久化
  • 4.redis数据类型
    • 4.1 string
    • 4.2 list
    • 4.3 set集合
    • 4.4 有序集合sort set
    • 4.5 hash
  • 5. redis常用操作
    • 5.1 关于string的操作
    • 5.2 关于list的操作
    • 5.3 关于集合的操作
    • 5.4 关于有序集合的操作
    • 5.5 关于hash的操作
  • 6. redis常用操作
  • 7. redis安全设置
  • 8. redis慢查询日志
  • 9. PHP中使用redis
    • 9.1 安装phpredis模块
    • 9.2 redis 存储session
  • 10. redis主从
  • 11. redis集群
    • 11.1 集群介绍
    • 11.1 集群搭建场景
    • 11.2 集群配置
    • 11.3 把ruby的源码包编译成rpm包
    • 11.4 集群配置操作
  • 12. 扩展

1. redis介绍

  • Redis和Memcached类似,也属于k-v数据存储
  • Redis官网 redis.io, 当前最新稳定版4.0.1
    支持更多value类型,除了和string外,还支持hash、lists(链表)、sets(集合)和sorted sets(有序集合)
  • redis使用了两种文件格式:全量数据(RDB)和增量请求(aof)。全量数据格式是把内存中的数据写入磁盘,便于下次读取文件进行加载。增量请求文件则是把内存中的数据序列化为操作请求,用于读取文件进行replay得到数据,这种类似于mysql binlog。
  • redis的存储分为内存存储、磁盘存储和log文件三部分

2. redis安装

2.1 下载redis

[root@linux-02 src]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz
--2019-07-14 23:11:44--  http://download.redis.io/releases/redis-5.0.5.tar.gz
正在解析主机 download.redis.io (download.redis.io)... 109.74.203.151
正在连接 download.redis.io (download.redis.io)|109.74.203.151|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1975750 (1.9M) [application/x-gzip]
正在保存至: “redis-5.0.5.tar.gz”

100%[========================================================================================================>] 1,975,750   8.76KB/s 用时 4m 53s 

2019-07-14 23:16:38 (6.58 KB/s) - 已保存 “redis-5.0.5.tar.gz” [1975750/1975750])

2.2 解压redis

[root@linux-02 src]# tar -zxvf  redis-5.0.5.tar.gz 
redis-5.0.5/
redis-5.0.5/.gitignore
redis-5.0.5/00-RELEASENOTES
redis-5.0.5/BUGS
redis-5.0.5/CONTRIBUTING
redis-5.0.5/COPYING
redis-5.0.5/INSTALL
redis-5.0.5/MANIFESTO
redis-5.0.5/Makefile
redis-5.0.5/README.md
redis-5.0.5/deps/
redis-5.0.5/deps/Makefile
redis-5.0.5/deps/README.md
redis-5.0.5/deps/hiredis/
redis-5.0.5/deps/hiredis/.gitignore
redis-5.0.5/deps/hiredis/.travis.yml
redis-5.0.5/deps/hiredis/CHANGELOG.md
redis-5.0.5/deps/hiredis/COPYING
redis-5.0.5/deps/hiredis/Makefile
redis-5.0.5/deps/hiredis/README.md
redis-5.0.5/deps/hiredis/adapters/
redis-5.0.5/deps/hiredis/adapters/ae.h
redis-5.0.5/deps/hiredis/adapters/glib.h
redis-5.0.5/deps/hiredis/adapters/ivykis.h
redis-5.0.5/deps/hiredis/adapters/libev.h
redis-5.0.5/deps/hiredis/adapters/libevent.h
redis-5.0.5/deps/hiredis/adapters/libuv.h
redis-5.0.5/deps/hiredis/adapters/macosx.h
redis-5.0.5/deps/hiredis/adapters/qt.h
redis-5.0.5/deps/hiredis/appveyor.yml
redis-5.0.5/deps/hiredis/async.c
redis-5.0.5/deps/hiredis/async.h
redis-5.0.5/deps/hiredis/dict.c
redis-5.0.5/deps/hiredis/dict.h
redis-5.0.5/deps/hiredis/examples/
redis-5.0.5/deps/hiredis/examples/example-ae.c
redis-5.0.5/deps/hiredis/examples/example-glib.c
redis-5.0.5/deps/hiredis/examples/example-ivykis.c
redis-5.0.5/deps/hiredis/examples/example-libev.c
redis-5.0.5/deps/hiredis/examples/example-libevent.c
redis-5.0.5/deps/hiredis/examples/example-libuv.c
redis-5.0.5/deps/hiredis/examples/example-macosx.c
redis-5.0.5/deps/hiredis/examples/example-qt.cpp
redis-5.0.5/deps/hiredis/examples/example-qt.h
redis-5.0.5/deps/hiredis/examples/example.c
redis-5.0.5/deps/hiredis/fmacros.h
redis-5.0.5/deps/hiredis/hiredis.c
redis-5.0.5/deps/hiredis/hiredis.h
redis-5.0.5/deps/hiredis/net.c
redis-5.0.5/deps/hiredis/net.h
redis-5.0.5/deps/hiredis/read.c
redis-5.0.5/deps/hiredis/read.h
redis-5.0.5/deps/hiredis/sds.c
redis-5.0.5/deps/hiredis/sds.h
redis-5.0.5/deps/hiredis/sdsalloc.h
redis-5.0.5/deps/hiredis/test.c
redis-5.0.5/deps/hiredis/win32.h
redis-5.0.5/deps/jemalloc/
redis-5.0.5/deps/jemalloc/.appveyor.yml
redis-5.0.5/deps/jemalloc/.autom4te.cfg
redis-5.0.5/deps/jemalloc/.gitattributes
redis-5.0.5/deps/jemalloc/.gitignore
redis-5.0.5/deps/jemalloc/.travis.yml
redis-5.0.5/deps/jemalloc/COPYING
redis-5.0.5/deps/jemalloc/ChangeLog
redis-5.0.5/deps/jemalloc/INSTALL.md
redis-5.0.5/deps/jemalloc/Makefile.in
redis-5.0.5/deps/jemalloc/README
redis-5.0.5/deps/jemalloc/TUNING.md
redis-5.0.5/deps/jemalloc/VERSION
redis-5.0.5/deps/jemalloc/autogen.sh
redis-5.0.5/deps/jemalloc/bin/
redis-5.0.5/deps/jemalloc/bin/jemalloc-config.in
redis-5.0.5/deps/jemalloc/bin/jemalloc.sh.in
redis-5.0.5/deps/jemalloc/bin/jeprof.in
redis-5.0.5/deps/jemalloc/build-aux/
redis-5.0.5/deps/jemalloc/build-aux/config.guess
redis-5.0.5/deps/jemalloc/build-aux/config.sub
redis-5.0.5/deps/jemalloc/build-aux/install-sh
redis-5.0.5/deps/jemalloc/config.stamp.in
redis-5.0.5/deps/jemalloc/configure
redis-5.0.5/deps/jemalloc/configure.ac
redis-5.0.5/deps/jemalloc/doc/
redis-5.0.5/deps/jemalloc/doc/html.xsl.in
redis-5.0.5/deps/jemalloc/doc/jemalloc.xml.in
redis-5.0.5/deps/jemalloc/doc/manpages.xsl.in
redis-5.0.5/deps/jemalloc/doc/stylesheet.xsl
redis-5.0.5/deps/jemalloc/include/
redis-5.0.5/deps/jemalloc/include/jemalloc/
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_inlines_a.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_inlines_b.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_stats.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_structs_a.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_structs_b.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/arena_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/assert.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/atomic.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/atomic_c11.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/atomic_gcc_atomic.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/atomic_gcc_sync.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/atomic_msvc.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/background_thread_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/background_thread_inlines.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/background_thread_structs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/base_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/base_inlines.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/base_structs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/base_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/bin.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/bin_stats.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/bit_util.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/bitmap.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/cache_bin.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/ckh.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/ctl.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/div.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/emitter.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_dss.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_inlines.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_mmap.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_structs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/extent_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/hash.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/hooks.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h.in
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_includes.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_a.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_b.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/jemalloc_preamble.h.in
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/large_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/log.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/malloc_io.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/mutex.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/mutex_pool.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/mutex_prof.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/nstime.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/pages.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/ph.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/private_namespace.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/private_symbols.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prng.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prof_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prof_inlines_a.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prof_inlines_b.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prof_structs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/prof_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/public_namespace.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/public_unnamespace.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/ql.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/qr.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/rb.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/rtree.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/rtree_tsd.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/size_classes.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/smoothstep.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/smoothstep.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/spin.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/stats.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/sz.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tcache_externs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tcache_inlines.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tcache_structs.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tcache_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/ticker.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd_generic.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd_tls.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd_types.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/tsd_win.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/util.h
redis-5.0.5/deps/jemalloc/include/jemalloc/internal/witness.h
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_defs.h.in
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_macros.h.in
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_mangle.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_protos.h.in
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_rename.sh
redis-5.0.5/deps/jemalloc/include/jemalloc/jemalloc_typedefs.h.in
redis-5.0.5/deps/jemalloc/include/msvc_compat/
redis-5.0.5/deps/jemalloc/include/msvc_compat/C99/
redis-5.0.5/deps/jemalloc/include/msvc_compat/C99/stdbool.h
redis-5.0.5/deps/jemalloc/include/msvc_compat/C99/stdint.h
redis-5.0.5/deps/jemalloc/include/msvc_compat/strings.h
redis-5.0.5/deps/jemalloc/include/msvc_compat/windows_extra.h
redis-5.0.5/deps/jemalloc/jemalloc.pc.in
redis-5.0.5/deps/jemalloc/m4/
redis-5.0.5/deps/jemalloc/m4/ax_cxx_compile_stdcxx.m4
redis-5.0.5/deps/jemalloc/msvc/
redis-5.0.5/deps/jemalloc/msvc/ReadMe.txt
redis-5.0.5/deps/jemalloc/msvc/jemalloc_vc2015.sln
redis-5.0.5/deps/jemalloc/msvc/jemalloc_vc2017.sln
redis-5.0.5/deps/jemalloc/msvc/projects/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/jemalloc/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/jemalloc/jemalloc.vcxproj
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/jemalloc/jemalloc.vcxproj.filters
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/test_threads/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/test_threads/test_threads.vcxproj
redis-5.0.5/deps/jemalloc/msvc/projects/vc2015/test_threads/test_threads.vcxproj.filters
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/jemalloc/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj.filters
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/test_threads/
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/test_threads/test_threads.vcxproj
redis-5.0.5/deps/jemalloc/msvc/projects/vc2017/test_threads/test_threads.vcxproj.filters
redis-5.0.5/deps/jemalloc/msvc/test_threads/
redis-5.0.5/deps/jemalloc/msvc/test_threads/test_threads.cpp
redis-5.0.5/deps/jemalloc/msvc/test_threads/test_threads.h
redis-5.0.5/deps/jemalloc/msvc/test_threads/test_threads_main.cpp
redis-5.0.5/deps/jemalloc/run_tests.sh
redis-5.0.5/deps/jemalloc/scripts/
redis-5.0.5/deps/jemalloc/scripts/gen_run_tests.py
redis-5.0.5/deps/jemalloc/scripts/gen_travis.py
redis-5.0.5/deps/jemalloc/src/
redis-5.0.5/deps/jemalloc/src/arena.c
redis-5.0.5/deps/jemalloc/src/background_thread.c
redis-5.0.5/deps/jemalloc/src/base.c
redis-5.0.5/deps/jemalloc/src/bin.c
redis-5.0.5/deps/jemalloc/src/bitmap.c
redis-5.0.5/deps/jemalloc/src/ckh.c
redis-5.0.5/deps/jemalloc/src/ctl.c
redis-5.0.5/deps/jemalloc/src/div.c
redis-5.0.5/deps/jemalloc/src/extent.c
redis-5.0.5/deps/jemalloc/src/extent_dss.c
redis-5.0.5/deps/jemalloc/src/extent_mmap.c
redis-5.0.5/deps/jemalloc/src/hash.c
redis-5.0.5/deps/jemalloc/src/hooks.c
redis-5.0.5/deps/jemalloc/src/jemalloc.c
redis-5.0.5/deps/jemalloc/src/jemalloc_cpp.cpp
redis-5.0.5/deps/jemalloc/src/large.c
redis-5.0.5/deps/jemalloc/src/log.c
redis-5.0.5/deps/jemalloc/src/malloc_io.c
redis-5.0.5/deps/jemalloc/src/mutex.c
redis-5.0.5/deps/jemalloc/src/mutex_pool.c
redis-5.0.5/deps/jemalloc/src/nstime.c
redis-5.0.5/deps/jemalloc/src/pages.c
redis-5.0.5/deps/jemalloc/src/prng.c
redis-5.0.5/deps/jemalloc/src/prof.c
redis-5.0.5/deps/jemalloc/src/rtree.c
redis-5.0.5/deps/jemalloc/src/stats.c
redis-5.0.5/deps/jemalloc/src/sz.c
redis-5.0.5/deps/jemalloc/src/tcache.c
redis-5.0.5/deps/jemalloc/src/ticker.c
redis-5.0.5/deps/jemalloc/src/tsd.c
redis-5.0.5/deps/jemalloc/src/witness.c
redis-5.0.5/deps/jemalloc/src/zone.c
redis-5.0.5/deps/jemalloc/test/
redis-5.0.5/deps/jemalloc/test/include/
redis-5.0.5/deps/jemalloc/test/include/test/
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-alti.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params11213.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params1279.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params132049.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params19937.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params216091.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params2281.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params4253.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params44497.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params607.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-params86243.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT-sse2.h
redis-5.0.5/deps/jemalloc/test/include/test/SFMT.h
redis-5.0.5/deps/jemalloc/test/include/test/btalloc.h
redis-5.0.5/deps/jemalloc/test/include/test/extent_hooks.h
redis-5.0.5/deps/jemalloc/test/include/test/jemalloc_test.h.in
redis-5.0.5/deps/jemalloc/test/include/test/jemalloc_test_defs.h.in
redis-5.0.5/deps/jemalloc/test/include/test/math.h
redis-5.0.5/deps/jemalloc/test/include/test/mq.h
redis-5.0.5/deps/jemalloc/test/include/test/mtx.h
redis-5.0.5/deps/jemalloc/test/include/test/test.h
redis-5.0.5/deps/jemalloc/test/include/test/thd.h
redis-5.0.5/deps/jemalloc/test/include/test/timer.h
redis-5.0.5/deps/jemalloc/test/integration/
redis-5.0.5/deps/jemalloc/test/integration/MALLOCX_ARENA.c
redis-5.0.5/deps/jemalloc/test/integration/aligned_alloc.c
redis-5.0.5/deps/jemalloc/test/integration/allocated.c
redis-5.0.5/deps/jemalloc/test/integration/cpp/
redis-5.0.5/deps/jemalloc/test/integration/cpp/basic.cpp
redis-5.0.5/deps/jemalloc/test/integration/extent.c
redis-5.0.5/deps/jemalloc/test/integration/extent.sh
redis-5.0.5/deps/jemalloc/test/integration/mallocx.c
redis-5.0.5/deps/jemalloc/test/integration/mallocx.sh
redis-5.0.5/deps/jemalloc/test/integration/overflow.c
redis-5.0.5/deps/jemalloc/test/integration/posix_memalign.c
redis-5.0.5/deps/jemalloc/test/integration/rallocx.c
redis-5.0.5/deps/jemalloc/test/integration/sdallocx.c
redis-5.0.5/deps/jemalloc/test/integration/thread_arena.c
redis-5.0.5/deps/jemalloc/test/integration/thread_tcache_enabled.c
redis-5.0.5/deps/jemalloc/test/integration/xallocx.c
redis-5.0.5/deps/jemalloc/test/integration/xallocx.sh
redis-5.0.5/deps/jemalloc/test/src/
redis-5.0.5/deps/jemalloc/test/src/SFMT.c
redis-5.0.5/deps/jemalloc/test/src/btalloc.c
redis-5.0.5/deps/jemalloc/test/src/btalloc_0.c
redis-5.0.5/deps/jemalloc/test/src/btalloc_1.c
redis-5.0.5/deps/jemalloc/test/src/math.c
redis-5.0.5/deps/jemalloc/test/src/mq.c
redis-5.0.5/deps/jemalloc/test/src/mtx.c
redis-5.0.5/deps/jemalloc/test/src/test.c
redis-5.0.5/deps/jemalloc/test/src/thd.c
redis-5.0.5/deps/jemalloc/test/src/timer.c
redis-5.0.5/deps/jemalloc/test/stress/
redis-5.0.5/deps/jemalloc/test/stress/microbench.c
redis-5.0.5/deps/jemalloc/test/test.sh.in
redis-5.0.5/deps/jemalloc/test/unit/
redis-5.0.5/deps/jemalloc/test/unit/SFMT.c
redis-5.0.5/deps/jemalloc/test/unit/a0.c
redis-5.0.5/deps/jemalloc/test/unit/arena_reset.c
redis-5.0.5/deps/jemalloc/test/unit/arena_reset_prof.c
redis-5.0.5/deps/jemalloc/test/unit/arena_reset_prof.sh
redis-5.0.5/deps/jemalloc/test/unit/atomic.c
redis-5.0.5/deps/jemalloc/test/unit/background_thread.c
redis-5.0.5/deps/jemalloc/test/unit/background_thread_enable.c
redis-5.0.5/deps/jemalloc/test/unit/base.c
redis-5.0.5/deps/jemalloc/test/unit/bit_util.c
redis-5.0.5/deps/jemalloc/test/unit/bitmap.c
redis-5.0.5/deps/jemalloc/test/unit/ckh.c
redis-5.0.5/deps/jemalloc/test/unit/decay.c
redis-5.0.5/deps/jemalloc/test/unit/decay.sh
redis-5.0.5/deps/jemalloc/test/unit/div.c
redis-5.0.5/deps/jemalloc/test/unit/emitter.c
redis-5.0.5/deps/jemalloc/test/unit/extent_quantize.c
redis-5.0.5/deps/jemalloc/test/unit/fork.c
redis-5.0.5/deps/jemalloc/test/unit/hash.c
redis-5.0.5/deps/jemalloc/test/unit/hooks.c
redis-5.0.5/deps/jemalloc/test/unit/junk.c
redis-5.0.5/deps/jemalloc/test/unit/junk.sh
redis-5.0.5/deps/jemalloc/test/unit/junk_alloc.c
redis-5.0.5/deps/jemalloc/test/unit/junk_alloc.sh
redis-5.0.5/deps/jemalloc/test/unit/junk_free.c
redis-5.0.5/deps/jemalloc/test/unit/junk_free.sh
redis-5.0.5/deps/jemalloc/test/unit/log.c
redis-5.0.5/deps/jemalloc/test/unit/mallctl.c
redis-5.0.5/deps/jemalloc/test/unit/malloc_io.c
redis-5.0.5/deps/jemalloc/test/unit/math.c
redis-5.0.5/deps/jemalloc/test/unit/mq.c
redis-5.0.5/deps/jemalloc/test/unit/mtx.c
redis-5.0.5/deps/jemalloc/test/unit/nstime.c
redis-5.0.5/deps/jemalloc/test/unit/pack.c
redis-5.0.5/deps/jemalloc/test/unit/pack.sh
redis-5.0.5/deps/jemalloc/test/unit/pages.c
redis-5.0.5/deps/jemalloc/test/unit/ph.c
redis-5.0.5/deps/jemalloc/test/unit/prng.c
redis-5.0.5/deps/jemalloc/test/unit/prof_accum.c
redis-5.0.5/deps/jemalloc/test/unit/prof_accum.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_active.c
redis-5.0.5/deps/jemalloc/test/unit/prof_active.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_gdump.c
redis-5.0.5/deps/jemalloc/test/unit/prof_gdump.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_idump.c
redis-5.0.5/deps/jemalloc/test/unit/prof_idump.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_reset.c
redis-5.0.5/deps/jemalloc/test/unit/prof_reset.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_tctx.c
redis-5.0.5/deps/jemalloc/test/unit/prof_tctx.sh
redis-5.0.5/deps/jemalloc/test/unit/prof_thread_name.c
redis-5.0.5/deps/jemalloc/test/unit/prof_thread_name.sh
redis-5.0.5/deps/jemalloc/test/unit/ql.c
redis-5.0.5/deps/jemalloc/test/unit/qr.c
redis-5.0.5/deps/jemalloc/test/unit/rb.c
redis-5.0.5/deps/jemalloc/test/unit/retained.c
redis-5.0.5/deps/jemalloc/test/unit/rtree.c
redis-5.0.5/deps/jemalloc/test/unit/size_classes.c
redis-5.0.5/deps/jemalloc/test/unit/slab.c
redis-5.0.5/deps/jemalloc/test/unit/smoothstep.c
redis-5.0.5/deps/jemalloc/test/unit/spin.c
redis-5.0.5/deps/jemalloc/test/unit/stats.c
redis-5.0.5/deps/jemalloc/test/unit/stats_print.c
redis-5.0.5/deps/jemalloc/test/unit/ticker.c
redis-5.0.5/deps/jemalloc/test/unit/tsd.c
redis-5.0.5/deps/jemalloc/test/unit/witness.c
redis-5.0.5/deps/jemalloc/test/unit/zero.c
redis-5.0.5/deps/jemalloc/test/unit/zero.sh
redis-5.0.5/deps/linenoise/
redis-5.0.5/deps/linenoise/.gitignore
redis-5.0.5/deps/linenoise/Makefile
redis-5.0.5/deps/linenoise/README.markdown
redis-5.0.5/deps/linenoise/example.c
redis-5.0.5/deps/linenoise/linenoise.c
redis-5.0.5/deps/linenoise/linenoise.h
redis-5.0.5/deps/lua/
redis-5.0.5/deps/lua/COPYRIGHT
redis-5.0.5/deps/lua/HISTORY
redis-5.0.5/deps/lua/INSTALL
redis-5.0.5/deps/lua/Makefile
redis-5.0.5/deps/lua/README
redis-5.0.5/deps/lua/doc/
redis-5.0.5/deps/lua/doc/contents.html
redis-5.0.5/deps/lua/doc/cover.png
redis-5.0.5/deps/lua/doc/logo.gif
redis-5.0.5/deps/lua/doc/lua.1
redis-5.0.5/deps/lua/doc/lua.css
redis-5.0.5/deps/lua/doc/lua.html
redis-5.0.5/deps/lua/doc/luac.1
redis-5.0.5/deps/lua/doc/luac.html
redis-5.0.5/deps/lua/doc/manual.css
redis-5.0.5/deps/lua/doc/manual.html
redis-5.0.5/deps/lua/doc/readme.html
redis-5.0.5/deps/lua/etc/
redis-5.0.5/deps/lua/etc/Makefile
redis-5.0.5/deps/lua/etc/README
redis-5.0.5/deps/lua/etc/all.c
redis-5.0.5/deps/lua/etc/lua.hpp
redis-5.0.5/deps/lua/etc/lua.ico
redis-5.0.5/deps/lua/etc/lua.pc
redis-5.0.5/deps/lua/etc/luavs.bat
redis-5.0.5/deps/lua/etc/min.c
redis-5.0.5/deps/lua/etc/noparser.c
redis-5.0.5/deps/lua/etc/strict.lua
redis-5.0.5/deps/lua/src/
redis-5.0.5/deps/lua/src/Makefile
redis-5.0.5/deps/lua/src/fpconv.c
redis-5.0.5/deps/lua/src/fpconv.h
redis-5.0.5/deps/lua/src/lapi.c
redis-5.0.5/deps/lua/src/lapi.h
redis-5.0.5/deps/lua/src/lauxlib.c
redis-5.0.5/deps/lua/src/lauxlib.h
redis-5.0.5/deps/lua/src/lbaselib.c
redis-5.0.5/deps/lua/src/lcode.c
redis-5.0.5/deps/lua/src/lcode.h
redis-5.0.5/deps/lua/src/ldblib.c
redis-5.0.5/deps/lua/src/ldebug.c
redis-5.0.5/deps/lua/src/ldebug.h
redis-5.0.5/deps/lua/src/ldo.c
redis-5.0.5/deps/lua/src/ldo.h
redis-5.0.5/deps/lua/src/ldump.c
redis-5.0.5/deps/lua/src/lfunc.c
redis-5.0.5/deps/lua/src/lfunc.h
redis-5.0.5/deps/lua/src/lgc.c
redis-5.0.5/deps/lua/src/lgc.h
redis-5.0.5/deps/lua/src/linit.c
redis-5.0.5/deps/lua/src/liolib.c
redis-5.0.5/deps/lua/src/llex.c
redis-5.0.5/deps/lua/src/llex.h
redis-5.0.5/deps/lua/src/llimits.h
redis-5.0.5/deps/lua/src/lmathlib.c
redis-5.0.5/deps/lua/src/lmem.c
redis-5.0.5/deps/lua/src/lmem.h
redis-5.0.5/deps/lua/src/loadlib.c
redis-5.0.5/deps/lua/src/lobject.c
redis-5.0.5/deps/lua/src/lobject.h
redis-5.0.5/deps/lua/src/lopcodes.c
redis-5.0.5/deps/lua/src/lopcodes.h
redis-5.0.5/deps/lua/src/loslib.c
redis-5.0.5/deps/lua/src/lparser.c
redis-5.0.5/deps/lua/src/lparser.h
redis-5.0.5/deps/lua/src/lstate.c
redis-5.0.5/deps/lua/src/lstate.h
redis-5.0.5/deps/lua/src/lstring.c
redis-5.0.5/deps/lua/src/lstring.h
redis-5.0.5/deps/lua/src/lstrlib.c
redis-5.0.5/deps/lua/src/ltable.c
redis-5.0.5/deps/lua/src/ltable.h
redis-5.0.5/deps/lua/src/ltablib.c
redis-5.0.5/deps/lua/src/ltm.c
redis-5.0.5/deps/lua/src/ltm.h
redis-5.0.5/deps/lua/src/lua.c
redis-5.0.5/deps/lua/src/lua.h
redis-5.0.5/deps/lua/src/lua_bit.c
redis-5.0.5/deps/lua/src/lua_cjson.c
redis-5.0.5/deps/lua/src/lua_cmsgpack.c
redis-5.0.5/deps/lua/src/lua_struct.c
redis-5.0.5/deps/lua/src/luac.c
redis-5.0.5/deps/lua/src/luaconf.h
redis-5.0.5/deps/lua/src/lualib.h
redis-5.0.5/deps/lua/src/lundump.c
redis-5.0.5/deps/lua/src/lundump.h
redis-5.0.5/deps/lua/src/lvm.c
redis-5.0.5/deps/lua/src/lvm.h
redis-5.0.5/deps/lua/src/lzio.c
redis-5.0.5/deps/lua/src/lzio.h
redis-5.0.5/deps/lua/src/print.c
redis-5.0.5/deps/lua/src/strbuf.c
redis-5.0.5/deps/lua/src/strbuf.h
redis-5.0.5/deps/lua/test/
redis-5.0.5/deps/lua/test/README
redis-5.0.5/deps/lua/test/bisect.lua
redis-5.0.5/deps/lua/test/cf.lua
redis-5.0.5/deps/lua/test/echo.lua
redis-5.0.5/deps/lua/test/env.lua
redis-5.0.5/deps/lua/test/factorial.lua
redis-5.0.5/deps/lua/test/fib.lua
redis-5.0.5/deps/lua/test/fibfor.lua
redis-5.0.5/deps/lua/test/globals.lua
redis-5.0.5/deps/lua/test/hello.lua
redis-5.0.5/deps/lua/test/life.lua
redis-5.0.5/deps/lua/test/luac.lua
redis-5.0.5/deps/lua/test/printf.lua
redis-5.0.5/deps/lua/test/readonly.lua
redis-5.0.5/deps/lua/test/sieve.lua
redis-5.0.5/deps/lua/test/sort.lua
redis-5.0.5/deps/lua/test/table.lua
redis-5.0.5/deps/lua/test/trace-calls.lua
redis-5.0.5/deps/lua/test/trace-globals.lua
redis-5.0.5/deps/lua/test/xd.lua
redis-5.0.5/deps/update-jemalloc.sh
redis-5.0.5/redis.conf
redis-5.0.5/runtest
redis-5.0.5/runtest-cluster
redis-5.0.5/runtest-moduleapi
redis-5.0.5/runtest-sentinel
redis-5.0.5/sentinel.conf
redis-5.0.5/src/
redis-5.0.5/src/.gitignore
redis-5.0.5/src/Makefile
redis-5.0.5/src/adlist.c
redis-5.0.5/src/adlist.h
redis-5.0.5/src/ae.c
redis-5.0.5/src/ae.h
redis-5.0.5/src/ae_epoll.c
redis-5.0.5/src/ae_evport.c
redis-5.0.5/src/ae_kqueue.c
redis-5.0.5/src/ae_select.c
redis-5.0.5/src/anet.c
redis-5.0.5/src/anet.h
redis-5.0.5/src/aof.c
redis-5.0.5/src/asciilogo.h
redis-5.0.5/src/atomicvar.h
redis-5.0.5/src/bio.c
redis-5.0.5/src/bio.h
redis-5.0.5/src/bitops.c
redis-5.0.5/src/blocked.c
redis-5.0.5/src/childinfo.c
redis-5.0.5/src/cluster.c
redis-5.0.5/src/cluster.h
redis-5.0.5/src/config.c
redis-5.0.5/src/config.h
redis-5.0.5/src/crc16.c
redis-5.0.5/src/crc64.c
redis-5.0.5/src/crc64.h
redis-5.0.5/src/db.c
redis-5.0.5/src/debug.c
redis-5.0.5/src/debugmacro.h
redis-5.0.5/src/defrag.c
redis-5.0.5/src/dict.c
redis-5.0.5/src/dict.h
redis-5.0.5/src/endianconv.c
redis-5.0.5/src/endianconv.h
redis-5.0.5/src/evict.c
redis-5.0.5/src/expire.c
redis-5.0.5/src/fmacros.h
redis-5.0.5/src/geo.c
redis-5.0.5/src/geo.h
redis-5.0.5/src/geohash.c
redis-5.0.5/src/geohash.h
redis-5.0.5/src/geohash_helper.c
redis-5.0.5/src/geohash_helper.h
redis-5.0.5/src/help.h
redis-5.0.5/src/hyperloglog.c
redis-5.0.5/src/intset.c
redis-5.0.5/src/intset.h
redis-5.0.5/src/latency.c
redis-5.0.5/src/latency.h
redis-5.0.5/src/lazyfree.c
redis-5.0.5/src/listpack.c
redis-5.0.5/src/listpack.h
redis-5.0.5/src/listpack_malloc.h
redis-5.0.5/src/localtime.c
redis-5.0.5/src/lolwut.c
redis-5.0.5/src/lolwut5.c
redis-5.0.5/src/lzf.h
redis-5.0.5/src/lzfP.h
redis-5.0.5/src/lzf_c.c
redis-5.0.5/src/lzf_d.c
redis-5.0.5/src/memtest.c
redis-5.0.5/src/mkreleasehdr.sh
redis-5.0.5/src/module.c
redis-5.0.5/src/modules/
redis-5.0.5/src/modules/.gitignore
redis-5.0.5/src/modules/Makefile
redis-5.0.5/src/modules/gendoc.rb
redis-5.0.5/src/modules/helloblock.c
redis-5.0.5/src/modules/hellocluster.c
redis-5.0.5/src/modules/hellodict.c
redis-5.0.5/src/modules/hellotimer.c
redis-5.0.5/src/modules/hellotype.c
redis-5.0.5/src/modules/helloworld.c
redis-5.0.5/src/modules/testmodule.c
redis-5.0.5/src/multi.c
redis-5.0.5/src/networking.c
redis-5.0.5/src/notify.c
redis-5.0.5/src/object.c
redis-5.0.5/src/pqsort.c
redis-5.0.5/src/pqsort.h
redis-5.0.5/src/pubsub.c
redis-5.0.5/src/quicklist.c
redis-5.0.5/src/quicklist.h
redis-5.0.5/src/rand.c
redis-5.0.5/src/rand.h
redis-5.0.5/src/rax.c
redis-5.0.5/src/rax.h
redis-5.0.5/src/rax_malloc.h
redis-5.0.5/src/rdb.c
redis-5.0.5/src/rdb.h
redis-5.0.5/src/redis-benchmark.c
redis-5.0.5/src/redis-check-aof.c
redis-5.0.5/src/redis-check-rdb.c
redis-5.0.5/src/redis-cli.c
redis-5.0.5/src/redis-trib.rb
redis-5.0.5/src/redisassert.h
redis-5.0.5/src/redismodule.h
redis-5.0.5/src/release.c
redis-5.0.5/src/replication.c
redis-5.0.5/src/rio.c
redis-5.0.5/src/rio.h
redis-5.0.5/src/scripting.c
redis-5.0.5/src/sds.c
redis-5.0.5/src/sds.h
redis-5.0.5/src/sdsalloc.h
redis-5.0.5/src/sentinel.c
redis-5.0.5/src/server.c
redis-5.0.5/src/server.h
redis-5.0.5/src/setproctitle.c
redis-5.0.5/src/sha1.c
redis-5.0.5/src/sha1.h
redis-5.0.5/src/siphash.c
redis-5.0.5/src/slowlog.c
redis-5.0.5/src/slowlog.h
redis-5.0.5/src/solarisfixes.h
redis-5.0.5/src/sort.c
redis-5.0.5/src/sparkline.c
redis-5.0.5/src/sparkline.h
redis-5.0.5/src/stream.h
redis-5.0.5/src/syncio.c
redis-5.0.5/src/t_hash.c
redis-5.0.5/src/t_list.c
redis-5.0.5/src/t_set.c
redis-5.0.5/src/t_stream.c
redis-5.0.5/src/t_string.c
redis-5.0.5/src/t_zset.c
redis-5.0.5/src/testhelp.h
redis-5.0.5/src/util.c
redis-5.0.5/src/util.h
redis-5.0.5/src/valgrind.sup
redis-5.0.5/src/version.h
redis-5.0.5/src/ziplist.c
redis-5.0.5/src/ziplist.h
redis-5.0.5/src/zipmap.c
redis-5.0.5/src/zipmap.h
redis-5.0.5/src/zmalloc.c
redis-5.0.5/src/zmalloc.h
redis-5.0.5/tests/
redis-5.0.5/tests/assets/
redis-5.0.5/tests/assets/default.conf
redis-5.0.5/tests/assets/encodings.rdb
redis-5.0.5/tests/assets/hash-zipmap.rdb
redis-5.0.5/tests/cluster/
redis-5.0.5/tests/cluster/cluster.tcl
redis-5.0.5/tests/cluster/run.tcl
redis-5.0.5/tests/cluster/tests/
redis-5.0.5/tests/cluster/tests/00-base.tcl
redis-5.0.5/tests/cluster/tests/01-faildet.tcl
redis-5.0.5/tests/cluster/tests/02-failover.tcl
redis-5.0.5/tests/cluster/tests/03-failover-loop.tcl
redis-5.0.5/tests/cluster/tests/04-resharding.tcl
redis-5.0.5/tests/cluster/tests/05-slave-selection.tcl
redis-5.0.5/tests/cluster/tests/06-slave-stop-cond.tcl
redis-5.0.5/tests/cluster/tests/07-replica-migration.tcl
redis-5.0.5/tests/cluster/tests/08-update-msg.tcl
redis-5.0.5/tests/cluster/tests/09-pubsub.tcl
redis-5.0.5/tests/cluster/tests/10-manual-failover.tcl
redis-5.0.5/tests/cluster/tests/11-manual-takeover.tcl
redis-5.0.5/tests/cluster/tests/12-replica-migration-2.tcl
redis-5.0.5/tests/cluster/tests/13-no-failover-option.tcl
redis-5.0.5/tests/cluster/tests/helpers/
redis-5.0.5/tests/cluster/tests/helpers/onlydots.tcl
redis-5.0.5/tests/cluster/tests/includes/
redis-5.0.5/tests/cluster/tests/includes/init-tests.tcl
redis-5.0.5/tests/cluster/tmp/
redis-5.0.5/tests/cluster/tmp/.gitignore
redis-5.0.5/tests/helpers/
redis-5.0.5/tests/helpers/bg_block_op.tcl
redis-5.0.5/tests/helpers/bg_complex_data.tcl
redis-5.0.5/tests/helpers/gen_write_load.tcl
redis-5.0.5/tests/instances.tcl
redis-5.0.5/tests/integration/
redis-5.0.5/tests/integration/aof-race.tcl
redis-5.0.5/tests/integration/aof.tcl
redis-5.0.5/tests/integration/block-repl.tcl
redis-5.0.5/tests/integration/convert-zipmap-hash-on-load.tcl
redis-5.0.5/tests/integration/logging.tcl
redis-5.0.5/tests/integration/psync2-reg.tcl
redis-5.0.5/tests/integration/psync2.tcl
redis-5.0.5/tests/integration/rdb.tcl
redis-5.0.5/tests/integration/redis-cli.tcl
redis-5.0.5/tests/integration/replication-2.tcl
redis-5.0.5/tests/integration/replication-3.tcl
redis-5.0.5/tests/integration/replication-4.tcl
redis-5.0.5/tests/integration/replication-psync.tcl
redis-5.0.5/tests/integration/replication.tcl
redis-5.0.5/tests/modules/
redis-5.0.5/tests/modules/Makefile
redis-5.0.5/tests/modules/commandfilter.c
redis-5.0.5/tests/sentinel/
redis-5.0.5/tests/sentinel/run.tcl
redis-5.0.5/tests/sentinel/tests/
redis-5.0.5/tests/sentinel/tests/00-base.tcl
redis-5.0.5/tests/sentinel/tests/01-conf-update.tcl
redis-5.0.5/tests/sentinel/tests/02-slaves-reconf.tcl
redis-5.0.5/tests/sentinel/tests/03-runtime-reconf.tcl
redis-5.0.5/tests/sentinel/tests/04-slave-selection.tcl
redis-5.0.5/tests/sentinel/tests/05-manual.tcl
redis-5.0.5/tests/sentinel/tests/06-ckquorum.tcl
redis-5.0.5/tests/sentinel/tests/07-down-conditions.tcl
redis-5.0.5/tests/sentinel/tests/includes/
redis-5.0.5/tests/sentinel/tests/includes/init-tests.tcl
redis-5.0.5/tests/sentinel/tmp/
redis-5.0.5/tests/sentinel/tmp/.gitignore
redis-5.0.5/tests/support/
redis-5.0.5/tests/support/cluster.tcl
redis-5.0.5/tests/support/redis.tcl
redis-5.0.5/tests/support/server.tcl
redis-5.0.5/tests/support/test.tcl
redis-5.0.5/tests/support/tmpfile.tcl
redis-5.0.5/tests/support/util.tcl
redis-5.0.5/tests/test_helper.tcl
redis-5.0.5/tests/tmp/
redis-5.0.5/tests/tmp/.gitignore
redis-5.0.5/tests/unit/
redis-5.0.5/tests/unit/aofrw.tcl
redis-5.0.5/tests/unit/auth.tcl
redis-5.0.5/tests/unit/bitfield.tcl
redis-5.0.5/tests/unit/bitops.tcl
redis-5.0.5/tests/unit/dump.tcl
redis-5.0.5/tests/unit/expire.tcl
redis-5.0.5/tests/unit/geo.tcl
redis-5.0.5/tests/unit/hyperloglog.tcl
redis-5.0.5/tests/unit/introspection-2.tcl
redis-5.0.5/tests/unit/introspection.tcl
redis-5.0.5/tests/unit/keyspace.tcl
redis-5.0.5/tests/unit/latency-monitor.tcl
redis-5.0.5/tests/unit/lazyfree.tcl
redis-5.0.5/tests/unit/limits.tcl
redis-5.0.5/tests/unit/maxmemory.tcl
redis-5.0.5/tests/unit/memefficiency.tcl
redis-5.0.5/tests/unit/moduleapi/
redis-5.0.5/tests/unit/moduleapi/commandfilter.tcl
redis-5.0.5/tests/unit/multi.tcl
redis-5.0.5/tests/unit/obuf-limits.tcl
redis-5.0.5/tests/unit/other.tcl
redis-5.0.5/tests/unit/pendingquerybuf.tcl
redis-5.0.5/tests/unit/printver.tcl
redis-5.0.5/tests/unit/protocol.tcl
redis-5.0.5/tests/unit/pubsub.tcl
redis-5.0.5/tests/unit/quit.tcl
redis-5.0.5/tests/unit/scan.tcl
redis-5.0.5/tests/unit/scripting.tcl
redis-5.0.5/tests/unit/slowlog.tcl
redis-5.0.5/tests/unit/sort.tcl
redis-5.0.5/tests/unit/type/
redis-5.0.5/tests/unit/type/hash.tcl
redis-5.0.5/tests/unit/type/incr.tcl
redis-5.0.5/tests/unit/type/list-2.tcl
redis-5.0.5/tests/unit/type/list-3.tcl
redis-5.0.5/tests/unit/type/list-common.tcl
redis-5.0.5/tests/unit/type/list.tcl
redis-5.0.5/tests/unit/type/set.tcl
redis-5.0.5/tests/unit/type/stream-cgroups.tcl
redis-5.0.5/tests/unit/type/stream.tcl
redis-5.0.5/tests/unit/type/string.tcl
redis-5.0.5/tests/unit/type/zset.tcl
redis-5.0.5/tests/unit/wait.tcl
redis-5.0.5/utils/
redis-5.0.5/utils/build-static-symbols.tcl
redis-5.0.5/utils/cluster_fail_time.tcl
redis-5.0.5/utils/corrupt_rdb.c
redis-5.0.5/utils/create-cluster/
redis-5.0.5/utils/create-cluster/.gitignore
redis-5.0.5/utils/create-cluster/README
redis-5.0.5/utils/create-cluster/create-cluster
redis-5.0.5/utils/generate-command-help.rb
redis-5.0.5/utils/graphs/
redis-5.0.5/utils/graphs/commits-over-time/
redis-5.0.5/utils/graphs/commits-over-time/README.md
redis-5.0.5/utils/graphs/commits-over-time/genhtml.tcl
redis-5.0.5/utils/hashtable/
redis-5.0.5/utils/hashtable/README
redis-5.0.5/utils/hashtable/rehashing.c
redis-5.0.5/utils/hyperloglog/
redis-5.0.5/utils/hyperloglog/.gitignore
redis-5.0.5/utils/hyperloglog/hll-err.rb
redis-5.0.5/utils/hyperloglog/hll-gnuplot-graph.rb
redis-5.0.5/utils/install_server.sh
redis-5.0.5/utils/lru/
redis-5.0.5/utils/lru/README
redis-5.0.5/utils/lru/lfu-simulation.c
redis-5.0.5/utils/lru/test-lru.rb
redis-5.0.5/utils/redis-copy.rb
redis-5.0.5/utils/redis-sha1.rb
redis-5.0.5/utils/redis_init_script
redis-5.0.5/utils/redis_init_script.tpl
redis-5.0.5/utils/releasetools/
redis-5.0.5/utils/releasetools/01_create_tarball.sh
redis-5.0.5/utils/releasetools/02_upload_tarball.sh
redis-5.0.5/utils/releasetools/03_test_release.sh
redis-5.0.5/utils/releasetools/04_release_hash.sh
redis-5.0.5/utils/releasetools/changelog.tcl
redis-5.0.5/utils/speed-regression.tcl
redis-5.0.5/utils/whatisdoing.sh
[root@linux-02 src]# cd redis-5.0.5/
[root@linux-02 redis-5.0.5]# 

2.3 安装redis

[root@linux-02 redis-5.0.5]# make && make install
cd src && make all
make[1]: 进入目录“/usr/local/src/redis-5.0.5/src”
    CC Makefile.dep
make[1]: 离开目录“/usr/local/src/redis-5.0.5/src”
make[1]: 进入目录“/usr/local/src/redis-5.0.5/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]: 进入目录“/usr/local/src/redis-5.0.5/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]: 离开目录“/usr/local/src/redis-5.0.5/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]: 进入目录“/usr/local/src/redis-5.0.5/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]: 进入目录“/usr/local/src/redis-5.0.5/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]: 离开目录“/usr/local/src/redis-5.0.5/deps/hiredis”
MAKE linenoise
cd linenoise && make
make[3]: 进入目录“/usr/local/src/redis-5.0.5/deps/linenoise”
cc  -Wall -Os -g  -c linenoise.c
make[3]: 离开目录“/usr/local/src/redis-5.0.5/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]: 进入目录“/usr/local/src/redis-5.0.5/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: 在函数‘f_parser’中:
ldo.c:496:7: 警告:未使用的变量‘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):在函数‘os_tmpname’中:
loslib.c:(.text+0x28c): 警告: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]: 离开目录“/usr/local/src/redis-5.0.5/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... /usr/bin/xsltproc
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... /usr/bin/autoconf
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           : /usr/bin/xsltproc
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/src/redis-5.0.5/deps/jemalloc/
objroot            : 
abs_objroot        : /usr/local/src/redis-5.0.5/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]: 进入目录“/usr/local/src/redis-5.0.5/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]: 离开目录“/usr/local/src/redis-5.0.5/deps/jemalloc”
make[2]: 离开目录“/usr/local/src/redis-5.0.5/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]: 离开目录“/usr/local/src/redis-5.0.5/src”
cd src && make install
make[1]: 进入目录“/usr/local/src/redis-5.0.5/src”
    CC Makefile.dep
make[1]: 离开目录“/usr/local/src/redis-5.0.5/src”
make[1]: 进入目录“/usr/local/src/redis-5.0.5/src”

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

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: 离开目录“/usr/local/src/redis-5.0.5/src”

2.4 复制配置文件

[root@linux-02 redis-5.0.5]# cp redis.conf  /etc/redis.conf
[root@linux-02 redis-5.0.5]# vim /etc/redis.conf 

daemonize yes  //如果是no表示在前台启动redis,如果是yes表示在后台启动redis

logfile "/var/log/redis.log"  //定义redis的日志文件位置

dir /data/redis //定义redis的数据目录

appendonly yes  //开启aof持久化

appendfilename "appendonly.aof"  //定义aof文件的名称

appendfsync everysec  //每秒记录一下aof文件

2.5 启动redis

[root@linux-02 redis-5.0.5]# mkdir /data/redis
[root@linux-02 redis-5.0.5]# redis-server /etc/redis.conf 
[root@linux-02 redis-5.0.5]# ps aux|grep redis
root      25767  0.0  0.9 153888  7656 ?        Ssl  23:32   0:00 redis-server 127.0.0.1:6379
root      25777  0.0  0.1 112724   984 pts/0    R+   23:32   0:00 grep --color=auto redis
[root@linux-02 redis-5.0.5]# 

2.6 查看redis日志

[root@linux-02 redis-5.0.5]# less /var/log/redis.log 

25766:C 14 Jul 2019 23:32:22.342 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25766:C 14 Jul 2019 23:32:22.342 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=25766, just started
25766:C 14 Jul 2019 23:32:22.342 # Configuration loaded
25767:M 14 Jul 2019 23:32:22.347 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 5.0.5 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 25767
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

25767:M 14 Jul 2019 23:32:22.348 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
25767:M 14 Jul 2019 23:32:22.348 # Server initialized
25767:M 14 Jul 2019 23:32:22.349 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue a
dd '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.
25767:M 14 Jul 2019 23:32:22.349 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memo
ry 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 yo
ur /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
25767:M 14 Jul 2019 23:32:22.349 * Ready to accept connections

2.6 修改内核参数

[root@linux-02 redis-5.0.5]# sysctl vm.overcommit_memory=1
vm.overcommit_memory = 1
[root@linux-02 redis-5.0.5]# echo never > /sys/kernel/mm/transparent_hugepage/enabled

建议把这两条命令写入/etc/rc.local文件中,系统开机即可写入。

[root@linux-02 redis-5.0.5]# vim /etc/rc.local 

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
sysctl vm.overcommit_memory=1
echo never > /sys/kernel/mm/transparent_hugepage/enabled

3. redis持久化

  • Redis提供了两种持久化的方式,分别是RDB(Redis DataBase)和AOF(Append Only File)
  • RDB,简而言之,就是在不同的时间点,将redis存储的数据生成快照并存储到磁盘等介质上。
  • AOF,则是换了一个角度来实现持久化,那就是将redis执行过的所有写指令记录下来,在下次redis重新启动时,只要把这些写指令从前到后再重复执行一遍,就可以实现数据恢复了。
  • 其实RDB和AOF两种方式也可以同时使用,在这种情况下,如果redis重启的话,则会优先采用AOF方式来进行数据恢复,这是因为AOF方式的数据恢复完整度更高。
  • 如果你没有数据持久化的需求,也完全可以关闭RDB和AOF方式,这样的话,redis将变成一个纯内存数据库,就像memcache一样。
#   save ""

save 900 1
save 300 10
save 60 10000

RDB持久化是如何实现把内存中的数据存储到磁盘上的呢,上面三条配置是redis.conf文件中的配置,表示的是900秒更改了一次,300秒更改了10次,60秒更改了10000次,就会导致把内存中的数据写入硬盘。如果说想关掉RDB持久化,可以把save这三行给注释,把save ""给打开即可。

# appendfsync always
appendfsync everysec
# appendfsync no

AOF持久化可以设置为上面三种模式,第一种是每时每刻都做备份,第二种是每秒,第三种是不做备份,可见第三种是最不安全的模式,第一种又会很占用系统磁盘的io,第二种是最合理也是最优的模式。

4.redis数据类型

4.1 string

  • string为最简单的类型,与Memcached一样的类型,一个key对应一个value,其支持的操作与Memcached的操作类似,它的功能更丰富。设置可以存二进制的对象。
[root@linux-02 redis-5.0.5]# redis-cli 
127.0.0.1:6379> set key1 123
OK
127.0.0.1:6379> get key1
"123"
127.0.0.1:6379> set ky2 abc ky3 bcd ky4 def
(error) ERR syntax error
127.0.0.1:6379> mset ky2 abc ky3 bcd ky4 def
OK
127.0.0.1:6379> MGET ky2 ky3 ky4
1) "abc"
2) "bcd"
3) "def"
127.0.0.1:6379> 

4.2 list

  • list是一个链表结构,主要功能是push、pop、获取一个范围的所有值等等。操作中key理解为链表的名字。
  • 使用 list 结构,我们可以轻松地实现最新消息排行等功能(比如新浪微博的 TimeLine )。list 的另一个应用就是消息队列,可以利用 list 的 push操作,将任务存在 list 中,然后工作线程再用pop操作将任务取出进行执行。
[root@linux-02 redis-5.0.5]# redis-cli 
127.0.0.1:6379> LPUSH list1 xihaji
(integer) 1
127.0.0.1:6379> LPUSH list1 1bc
(integer) 2
127.0.0.1:6379> LPUSH list1 123
(integer) 3
127.0.0.1:6379> LRANGE list1 0 -1
1) "123"
2) "1bc"
3) "xihaji"
127.0.0.1:6379> LPOP list1
"123"
127.0.0.1:6379> LRANGE list1 0 -1
1) "1bc"
2) "xihaji"
127.0.0.1:6379> 

4.3 set集合

  • set是集合,和我们数学中的集合概念相似,对集合的操作有添加删除元素,有对多个集合求交并差等操作。操作中key理解为集合的名字。比如在微博应用中,可以将一个用户所有的关注人存在一个集合中,将其所有粉丝存在一个集合。因为 Redis 非常人性化的为集合提供了求交集、并集、差集等操作,那么就可以非常方便的实现如共同关注、共同喜好、二度好友等功能,对上面的所有集合操作,你还可以使用不同的命令选择将结果返回给客户端还是存集到一个新的集合中。
127.0.0.1:6379> SADD set1 a  //设置set1的值
(integer) 1
127.0.0.1:6379> SADD set1 b
(integer) 1
127.0.0.1:6379> SADD set1 c
(integer) 1
127.0.0.1:6379> SADD set1 d
(integer) 1
127.0.0.1:6379> SMEMBERS set1  //查看set1的值
1) "d"
2) "c"
3) "a"
4) "b"
127.0.0.1:6379> SADD set2 a
(integer) 1
127.0.0.1:6379> SADD set2 b
(integer) 1
127.0.0.1:6379> SADD set2 1
(integer) 1
127.0.0.1:6379> SADD set2 5
(integer) 1
127.0.0.1:6379> SMEMBERS set2
1) "5"
2) "a"
3) "1"
4) "b"
127.0.0.1:6379> SUNION set1 set2  //求set1和set2并集
1) "a"
2) "5"
3) "d"
4) "c"
5) "1"
6) "b"
127.0.0.1:6379> SINTER set1 set2 //求set1和set2的交集
1) "a"
2) "b"
127.0.0.1:6379> SDIFF set1 set2  求set1和set2的差集
1) "c"
2) "d"
127.0.0.1:6379> SREM set1 a  //删除值
(integer) 1
127.0.0.1:6379> SMEMBERS set1
1) "d"
2) "c"
3) "b"
127.0.0.1:6379> 

4.4 有序集合sort set

  • sorted set是有序集合,它比set多了一个权重参数score,使得集合中的元素能够按 score 进行有序排列,比如一个存储全班同学成绩的 Sorted Sets,其集合 value 可以是同学的学号,而 score 就可以是其考试得分,这样在数据插入集合的时候,就已经进行了天然的排序。
127.0.0.1:6379> ZADD set3 12 abc
(integer) 1
127.0.0.1:6379> ZADD set3 2 hddh
(integer) 1
127.0.0.1:6379> ZADD set3 24 klis
(integer) 1
127.0.0.1:6379> zadd set3 18 linux
(integer) 1

127.0.0.1:6379> ZRANGE set3  0 -1    //正序排列
1) "hddh"
2) "abc"
3) "linux"
4) "klis"
127.0.0.1:6379> ZREVRANGE set3 0 -1  //倒序排列
1) "klis"
2) "linux"
3) "abc"
4) "hddh"

4.5 hash

  • 在 Memcached 中,我们经常将一些结构化的信息打包成 hashmap,在客户端序列化后存储为一个字符串的值(一般是 JSON 格式),比如用户的昵称、年龄、性别、积分等。
127.0.0.1:6379> HSET hash1 name xihaji
(integer) 1
127.0.0.1:6379> HSET hash1 age 18
(integer) 1
127.0.0.1:6379> HSET hash1 job it
(integer) 1
127.0.0.1:6379> HSET hash1 top  gao
(integer) 1

127.0.0.1:6379> HGETALL hash1  //查看数值
1) "name"
2) "xihaji"
3) "age"
4) "18"
5) "job"
6) "it"
7) "top"
8) "gao"
127.0.0.1:6379> 

5. redis常用操作

5.1 关于string的操作

[root@linux-02 redis-5.0.5]# redis-cli
127.0.0.1:6379> set key1 123
OK
127.0.0.1:6379> set key1 abc  //第二次set会覆盖第一次的key值
OK
127.0.0.1:6379> get key1
"abc"
127.0.0.1:6379> SETNX key1 bcd  //使用setnx可以判断key是否存在,如果是0,表示存在,不赋值。
(integer) 0
127.0.0.1:6379> get key1
"abc"
127.0.0.1:6379> SETEX key1 10 111  //setex可以给值增加一个时效性,10代表是10s后过期。
OK
127.0.0.1:6379> get key1
"111"
127.0.0.1:6379> get key1
(nil)
127.0.0.1:6379> set key2 aaa ex 10  //可以使用这种方法给key设置过期时间
OK
127.0.0.1:6379> get key2
"aaa"
127.0.0.1:6379> get key2
(nil)
127.0.0.1:6379>

5.2 关于list的操作

127.0.0.1:6379> LPUSH list1  aaa
(integer) 1
127.0.0.1:6379> LPUSH list1  bbb //从左侧加入一个数值
(integer) 2
127.0.0.1:6379> LPUSH list1  111
(integer) 3
127.0.0.1:6379> LRANGE list1 0 -1
1) "111"
2) "bbb"
3) "aaa"
127.0.0.1:6379> RPOP list1  //从右侧取出一个数值
"aaa"
127.0.0.1:6379> LRANGE list1 0 -1
1) "111"
2) "bbb"
127.0.0.1:6379> LPOP list1  //从左侧取出一个数值
"111"
127.0.0.1:6379> LRANGE list1 0 -1
1) "bbb"
127.0.0.1:6379> RPUSH list1 ccc  //从右侧加入一个数值
(integer) 2
127.0.0.1:6379> LRANGE list1 0 -1
1) "bbb"
2) "ccc"

127.0.0.1:6379> LRANGE list1 0 -1
1) "bbb"
2) "ccc"
3) "222"
127.0.0.1:6379> LINSERT list1 before 222 111  //在数值222的前面加入数值111
(integer) 4
127.0.0.1:6379> LINSERT list1 after 222 333   //在数值222的后面加入数值333
(integer) 5
127.0.0.1:6379> LRANGE list1 0 -1
1) "bbb"
2) "ccc"
3) "111"
4) "222"
5) "333"
127.0.0.1:6379> LSET list1  4  888    //把第5个数值修改为888,第一位是0.
OK
127.0.0.1:6379> LRANGE list1 0 -1
1) "bbb"
2) "ccc"
3) "111"
4) "222"
5) "888"
127.0.0.1:6379> LINDEX list1 0  //查看链表中第一列的元素的值
"bbb"
127.0.0.1:6379> LLEN list1  //查看链表中有几个元素
(integer) 5

5.3 关于集合的操作

127.0.0.1:6379> SADD set1  aaa
(integer) 1
127.0.0.1:6379> SADD set1  bbb
(integer) 1
127.0.0.1:6379> SADD set1  111
(integer) 1
127.0.0.1:6379> SADD set1  222
(integer) 1
127.0.0.1:6379>
127.0.0.1:6379> SMEMBERS set1
1) "aaa"
2) "222"
3) "bbb"
4) "111"
127.0.0.1:6379> SREM set1 aaa  //删除集合中的元素aaa
(integer) 1
127.0.0.1:6379> SMEMBERS set1
1) "222"
2) "bbb"
3) "111"
127.0.0.1:6379> SADD set1 aaa  
(integer) 1
127.0.0.1:6379> SMEMBERS set1
1) "aaa"
2) "222"
3) "bbb"
4) "111"
127.0.0.1:6379>
127.0.0.1:6379> SADD set2 aaa
(integer) 1
127.0.0.1:6379> SADD set2 111
(integer) 1
127.0.0.1:6379> SADD set2 ddd
(integer) 1
127.0.0.1:6379> SADD set2 333
(integer) 1
127.0.0.1:6379> SMEMBERS set2
1) "aaa"
2) "333"
3) "ddd"
4) "111"
127.0.0.1:6379> SPOP set2  //从集合中随机取出一个数值并且删除
"111"
127.0.0.1:6379> SMEMBERS set2
1) "aaa"
2) "333"
3) "ddd"
127.0.0.1:6379> SADD set2 111
(integer) 1

127.0.0.1:6379> SMEMBERS set1
1) "aaa"
2) "222"
3) "bbb"
4) "111"
127.0.0.1:6379> SMEMBERS set2
1) "aaa"
2) "333"
3) "ddd"
4) "111"
127.0.0.1:6379> SDIFF set1 set2   //以集合set1为基础,比较和set2的差集,就是set1中含有的数字,set2中不包含。
1) "bbb"
2) "222"
127.0.0.1:6379> SMEMBERS set1
1) "aaa"
2) "222"
3) "bbb"
4) "111"
127.0.0.1:6379> SMEMBERS set2
1) "aaa"
2) "333"
3) "ddd"
4) "111"
127.0.0.1:6379> SDIFFSTORE setc set1 set2  //set1与set2的差集存储到setc中
(integer) 2
127.0.0.1:6379> SMEMBERS setc
1) "bbb"
2) "222"

127.0.0.1:6379> SINTER set1 set2  //求set1和set2的交集,sinterstore可以把交集存储到另外一个集合
1) "aaa"
2) "111"
127.0.0.1:6379> SUNION set1 set2  //求set1和set2的并集,sunionstore可以把并集存储到另外一个集合
1) "aaa"
2) "222"
3) "bbb"
4) "ddd"
5) "333"
6) "111"

127.0.0.1:6379> SISMEMBER set1 hhh   //判断一个元素是否存储在集合中,如果是0,表示不存在
(integer) 0
127.0.0.1:6379> SISMEMBER set1 222    //判断一个元素是否存储在集合中,如果是1,表示存在
(integer) 1


127.0.0.1:6379> SRANDMEMBER set1  //随机从集合中取出一个元素
"aaa"
127.0.0.1:6379> SRANDMEMBER set1 2  // 2代表随机从集合中取出两个元素
1) "aaa"
2) "bbb"
127.0.0.1:6379> SRANDMEMBER set1   
"111"
127.0.0.1:6379> SMEMBERS set1
1) "aaa"
2) "222"
3) "bbb"
4) "111"

5.4 关于有序集合的操作

127.0.0.1:6379> ZADD zset1 10 ppp
(integer) 1
127.0.0.1:6379> ZADD zset1 15 ooo
(integer) 1
127.0.0.1:6379> ZADD zset1 20 iii
(integer) 1
127.0.0.1:6379> ZADD zset1 30  uuu
(integer) 1
127.0.0.1:6379> ZADD zset1 50  999
(integer) 1
127.0.0.1:6379> ZADD zset1 100  900
(integer) 1
127.0.0.1:6379> ZRANGE zset1 0 -1  //显示所有元素,按score顺序显示
1) "ppp"
2) "ooo"
3) "iii"
4) "uuu"
5) "999"
6) "900"
127.0.0.1:6379> ZADD zset1 44  888
(integer) 1
127.0.0.1:6379> ZRANGE zset1 0 -1
1) "ppp"
2) "ooo"
3) "iii"
4) "uuu"
5) "888"
6) "999"
7) "900"
127.0.0.1:6379> ZREM  zset1 iii  //删除有序集合中值为iii的元素
(integer) 1
127.0.0.1:6379> ZRANGE zset1 0 -1
1) "ppp"
2) "ooo"
3) "uuu"
4) "888"
5) "999"
6) "900"
127.0.0.1:6379> ZRANK zset1 900 //显示有序集合中元素为900的正序索引值
(integer) 5
127.0.0.1:6379> ZREVRANK zset1 900  //显示有序集合中元素为900的倒序索引值
(integer) 0
127.0.0.1:6379> ZREVRANGE zset1 0 -1  //显示所有元素,按score反序显示
1) "900"
2) "999"
3) "888"
4) "uuu"
5) "ooo"
6) "ppp"
127.0.0.1:6379> ZCARD zset1  //显示有序集合红所有元素的个数
(integer) 6
127.0.0.1:6379> ZCOUNT zset1 10 40   //显示sorce分值是10到40之间元素的个数
(integer) 3


127.0.0.1:6379> zadd zset1 10 aaa
(integer) 1
127.0.0.1:6379> zadd zset1 14  bbb
(integer) 1
127.0.0.1:6379> zadd zset1 17 ccc
(integer) 1
127.0.0.1:6379> zadd zset1 23 ddd
(integer) 1
127.0.0.1:6379> ZRANGE zset1 0 -1
1) "aaa"
2) "bbb"
3) "ccc"
4) "ddd"
127.0.0.1:6379> ZREMRANGEBYRANK zset1 0 1  //删除有序集合中按score正序排列索引中前两为的元素
(integer) 2
127.0.0.1:6379> ZRANGE zset1 0 -1
1) "ccc"
2) "ddd"
127.0.0.1:6379> ZREMRANGEBYscore zset1 20  23   //删除有序集合中score分值为20到23之间的元素
(integer) 1
127.0.0.1:6379> ZRANGE zset1 0 -1
1) "ccc"
127.0.0.1:6379>

5.5 关于hash的操作

127.0.0.1:6379> HMSET hash1 a 0 b 2 c 8 d 6  //批量创建键值对
OK

127.0.0.1:6379> HGETALL hash1  //显示所有hash1中的键值
1) "a"
2) "0"
3) "b"
4) "2"
5) "c"
6) "8"
7) "d"
8) "6"
127.0.0.1:6379> HDEL hash1 d  //删除hash1中key为d的元素
(integer) 1
127.0.0.1:6379> HGETALL hash1
1) "a"
2) "0"
3) "b"
4) "2"
5) "c"
6) "8"
127.0.0.1:6379> HKEYS hash1 //显示hash1中所有key的信息
1) "a"
2) "b"
3) "c"
127.0.0.1:6379> HVALS hash1  //显示hash1中所有 value的信息
1) "0"
2) "2"
3) "8"
127.0.0.1:6379> HLEN hash1   //查看hash有几个filed
(integer) 3
127.0.0.1:6379> 

6. redis常用操作

127.0.0.1:6379> keys *  //显示出所有的keys
1) "hash1"
2) "zset1"
3) "setc"
4) "set2"
5) "list1"
6) "set1"
127.0.0.1:6379> KEYS set*  //模糊匹配
1) "setc"
2) "set2"
3) "set1"
127.0.0.1:6379> EXISTS setb  // 判断key是否存在,不存在显示0,存在显示1
(integer) 0
127.0.0.1:6379> EXISTS set1
(integer) 1
127.0.0.1:6379> DEL set1
(integer) 1
127.0.0.1:6379> get set1
(nil)
127.0.0.1:6379> EXPIRE set2  1000  //给key增加过期时间
(integer) 1
127.0.0.1:6379> ttl set2    //查看key过期的时间
(integer) 992
127.0.0.1:6379> ttl set2
(integer) 990
127.0.0.1:6379> ttl set2
(integer) 990
127.0.0.1:6379> ttl set2
(integer) 989
127.0.0.1:6379> PERSIST set2   //取消key的过期时间
(integer) 1
127.0.0.1:6379> ttl set2   //如果key没有过期时间,显示为-1,如果key不存在,显示为-2。
(integer) -1
127.0.0.1:6379> ttl set1
(integer) -2
127.0.0.1:6379> SELECT 1    //redis共有16个库,可以用select选择一个库
OK
127.0.0.1:6379[1]> keys *  
(empty list or set)
127.0.0.1:6379[1]> SELECT 0
OK

127.0.0.1:6379> MOVE set2 1  //移动set2到库1
(integer) 1
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> keys *
1) "set2"
127.0.0.1:6379[1]> select 0
OK
127.0.0.1:6379> keys *
1) "hash1"
2) "zset1"
3) "setc"
4) "list1"
127.0.0.1:6379> RANDOMKEY  //随机显示一个key
"list1"
127.0.0.1:6379> RANDOMKEY
"setc"
127.0.0.1:6379> RANDOMKEY
"list1"
127.0.0.1:6379> RANDOMKEY
"hash1"
127.0.0.1:6379> RENAME list1  listbbb   //重命名key
OK
127.0.0.1:6379> keys *
1) "listbbb"
2) "hash1"
3) "zset1"
4) "setc"
127.0.0.1:6379> type listbbb  //显示出key的类型
list
127.0.0.1:6379> type hash1
hash

127.0.0.1:6379> DBSIZE   //显示出数据库中key的总数
(integer) 4
127.0.0.1:6379> info   //显示redis的状态配置信息
# Server
redis_version:5.0.5
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:48012d2518b97f9c
redis_mode:standalone
os:Linux 3.10.0-957.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:4.8.5
process_id:11698
run_id:07f82a13bdd5a66eb836e401ab4029190d7b5a50
tcp_port:6379
uptime_in_seconds:16089
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:2937179
executable:/usr/local/src/redis-5.0.5/redis-server
config_file:/etc/redis.conf

# Clients
connected_clients:1
client_recent_max_input_buffer:2
client_recent_max_output_buffer:0
blocked_clients:0

# Memory
used_memory:855368
used_memory_human:835.32K
used_memory_rss:3715072
used_memory_rss_human:3.54M
used_memory_peak:874856
used_memory_peak_human:854.35K
used_memory_peak_perc:97.77%
used_memory_overhead:841500
used_memory_startup:791368
used_memory_dataset:13868
used_memory_dataset_perc:21.67%
allocator_allocated:907872
allocator_active:1118208
allocator_resident:10706944
total_system_memory:852025344
total_system_memory_human:812.55M
used_memory_lua:37888
used_memory_lua_human:37.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:1.23
allocator_frag_bytes:210336
allocator_rss_ratio:9.58
allocator_rss_bytes:9588736
rss_overhead_ratio:0.35
rss_overhead_bytes:-6991872
mem_fragmentation_ratio:4.57
mem_fragmentation_bytes:2901704
mem_not_counted_for_evict:110
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:49694
mem_aof_buffer:110
mem_allocator:jemalloc-5.1.0
active_defrag_running:0
lazyfree_pending_objects:0

# Persistence
loading:0
rdb_changes_since_last_save:1
rdb_bgsave_in_progress:0
rdb_last_save_time:1563218142
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:270336
aof_enabled:1
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0
aof_current_size:2112
aof_base_size:0
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:0

# Stats
total_connections_received:1
total_commands_processed:138
instantaneous_ops_per_sec:0
total_net_input_bytes:5165
total_net_output_bytes:14155
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:2
expired_stale_perc:0.00
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:58
keyspace_misses:8
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:292
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0

# Replication
role:master
connected_slaves:0
master_replid:045e23894ee12a81098eddf49003e6c016297392
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:9.156767
used_cpu_user:10.311202
used_cpu_sys_children:0.012887
used_cpu_user_children:0.001543

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=4,expires=0,avg_ttl=0
db1:keys=1,expires=0,avg_ttl=0

127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> FLUSHdb   //清空当前数据库中所有的信息
OK 
127.0.0.1:6379[1]> keys *
(empty list or set)
127.0.0.1:6379[1]> FLUSHALL  //清空数据库中所有的信息
OK
127.0.0.1:6379[1]> keys *
(empty list or set)
127.0.0.1:6379[1]> select *
(error) ERR invalid DB index
127.0.0.1:6379[1]> select 0
OK
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> BGSAVE  //在后台保存数据库信息
Background saving started
127.0.0.1:6379> save    //在前台保存数据库信息
OK
127.0.0.1:6379> CONFIG GET *   //获取所有配置信息
  1) "dbfilename"
  2) "dump.rdb"
  3) "requirepass"
  4) ""
  5) "masterauth"
  6) ""
  7) "cluster-announce-ip"
  8) ""
  9) "unixsocket"
 10) ""
 11) "logfile"
 12) "/var/log/redis.log"
 13) "pidfile"
 14) "/var/run/redis_6379.pid"
 15) "slave-announce-ip"
 16) ""
 17) "replica-announce-ip"
 18) ""
 19) "maxmemory"
 20) "0"
 21) "proto-max-bulk-len"
 22) "536870912"
 23) "client-query-buffer-limit"
 24) "1073741824"
 25) "maxmemory-samples"
 26) "5"
 27) "lfu-log-factor"
 28) "10"
 29) "lfu-decay-time"
 30) "1"
 31) "timeout"
 32) "0"
 33) "active-defrag-threshold-lower"
 34) "10"
 35) "active-defrag-threshold-upper"
 36) "100"
 37) "active-defrag-ignore-bytes"
 38) "104857600"
 39) "active-defrag-cycle-min"
 40) "5"
 41) "active-defrag-cycle-max"
 42) "75"
 43) "active-defrag-max-scan-fields"
 44) "1000"
 45) "auto-aof-rewrite-percentage"
 46) "100"
 47) "auto-aof-rewrite-min-size"
 48) "67108864"
 49) "hash-max-ziplist-entries"
 50) "512"
 51) "hash-max-ziplist-value"
 52) "64"
 53) "stream-node-max-bytes"
 54) "4096"
 55) "stream-node-max-entries"
 56) "100"
 57) "list-max-ziplist-size"
 58) "-2"
 59) "list-compress-depth"
 60) "0"
 61) "set-max-intset-entries"
 62) "512"
 63) "zset-max-ziplist-entries"
 64) "128"
 65) "zset-max-ziplist-value"
 66) "64"
 67) "hll-sparse-max-bytes"
 68) "3000"
 69) "lua-time-limit"
 70) "5000"
 71) "slowlog-log-slower-than"
 72) "10000"
 73) "latency-monitor-threshold"
 74) "0"
 75) "slowlog-max-len"
 76) "128"
 77) "port"
 78) "6379"
 79) "cluster-announce-port"
 80) "0"
 81) "cluster-announce-bus-port"
 82) "0"
 83) "tcp-backlog"
 84) "511"
 85) "databases"
 86) "16"
 87) "repl-ping-slave-period"
 88) "10"
 89) "repl-ping-replica-period"
 90) "10"
 91) "repl-timeout"
 92) "60"
 93) "repl-backlog-size"
 94) "1048576"
 95) "repl-backlog-ttl"
 96) "3600"
 97) "maxclients"
 98) "10000"
 99) "watchdog-period"
100) "0"
101) "slave-priority"
102) "100"
103) "replica-priority"
104) "100"
105) "slave-announce-port"
106) "0"
107) "replica-announce-port"
108) "0"
109) "min-slaves-to-write"
110) "0"
111) "min-replicas-to-write"
112) "0"
113) "min-slaves-max-lag"
114) "10"
115) "min-replicas-max-lag"
116) "10"
117) "hz"
118) "10"
119) "cluster-node-timeout"
120) "15000"
121) "cluster-migration-barrier"
122) "1"
123) "cluster-slave-validity-factor"
124) "10"
125) "cluster-replica-validity-factor"
126) "10"
127) "repl-diskless-sync-delay"
128) "5"
129) "tcp-keepalive"
130) "300"
131) "cluster-require-full-coverage"
132) "yes"
133) "cluster-slave-no-failover"
134) "no"
135) "cluster-replica-no-failover"
136) "no"
137) "no-appendfsync-on-rewrite"
138) "no"
139) "slave-serve-stale-data"
140) "yes"
141) "replica-serve-stale-data"
142) "yes"
143) "slave-read-only"
144) "yes"
145) "replica-read-only"
146) "yes"
147) "slave-ignore-maxmemory"
148) "yes"
149) "replica-ignore-maxmemory"
150) "yes"
151) "stop-writes-on-bgsave-error"
152) "yes"
153) "daemonize"
154) "yes"
155) "rdbcompression"
156) "yes"
157) "rdbchecksum"
158) "yes"
159) "activerehashing"
160) "yes"
161) "activedefrag"
162) "no"
163) "protected-mode"
164) "yes"
165) "repl-disable-tcp-nodelay"
166) "no"
167) "repl-diskless-sync"
168) "no"
169) "aof-rewrite-incremental-fsync"
170) "yes"
171) "rdb-save-incremental-fsync"
172) "yes"
173) "aof-load-truncated"
174) "yes"
175) "aof-use-rdb-preamble"
176) "yes"
177) "lazyfree-lazy-eviction"
178) "no"
179) "lazyfree-lazy-expire"
180) "no"
181) "lazyfree-lazy-server-del"
182) "no"
183) "slave-lazy-flush"
184) "no"
185) "replica-lazy-flush"
186) "no"
187) "dynamic-hz"
188) "yes"
189) "maxmemory-policy"
190) "noeviction"
191) "loglevel"
192) "notice"
193) "supervised"
194) "no"
195) "appendfsync"
196) "everysec"
197) "syslog-facility"
198) "local0"
199) "appendonly"
200) "yes"
201) "dir"
202) "/data/redis"
203) "save"
204) "900 1 300 10 60 10000"
205) "client-output-buffer-limit"
206) "normal 0 0 0 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
207) "unixsocketperm"
208) "0"
209) "slaveof"
210) ""
211) "notify-keyspace-events"
212) ""
213) "bind"
214) "127.0.0.1"
127.0.0.1:6379>config set dir    //修改配置信息

数据恢复: 首先定义或者确定dir目录和dbfilename,然后把备份的rdb文件放到dir目录下面,重启redis服务即可恢复数据

7. redis安全设置

  • 设置监听ip
  • bind 127.0.0.1 2.2.2.2//可以是多个ip,用空格分隔
  • 设置监听端口
  • port 16000
  • 设置密码
  • requirepass aming>com
  • redis-cli -a ‘aming>com’
  • 将config命令改名
  • rename-command CONFIG aming
  • 禁掉config命令
  • rename-command CONFIG “”

8. redis慢查询日志

  • 编辑配置文件/etc/redis.conf
  • 针对慢查询日志,可以设置两个参数,一个是执行时长,单位是微秒,另一个是慢查询日志的长度。当一个新的命令被写入日志时,最老的一条会从命令日志队列中被移除。
  • slowlog-log-slower-than 1000 //单位ms,表示慢于1000ms则记录日志
  • slowlog-max-len 128 //定义日志长度,表示最多存128条
  • slowlog get //列出所有的慢查询日志
  • slowlog get 2 //只列出2条
  • slowlog len //查看慢查询日志条数

9. PHP中使用redis

9.1 安装phpredis模块

[root@linux-02 ~]#cd /usr/local/src/

[root@linux-02 src]# wget https://coding.net/u/aminglinux/p/yuanke_centos7/git/raw/master/21NOSQL/phpredis.zip

[root@linux-02 src]# unzip phpredis.zip
 
[root@linux-02 src]# cd phpredis-develop/

[root@linux-02 phpredis-develop]# /usr/local/php-fpm/bin/phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226

[root@linux-02 phpredis-develop]#  ./configure --with-php-config=/usr/local/php-fpm/bin/php-config
安装省略

[root@linux-02 phpredis-develop]#  make
安装省略

[root@linux-02 phpredis-develop]# make install
Installing shared extensions:     /usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20131226/
[root@linux-02 phpredis-develop]# ls /usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20131226/
memcache.so  opcache.a  opcache.so  redis.so


[root@linux-02 phpredis-develop]# vim /usr/local/php-fpm/etc/php.ini
## 添加如下内容 ##
extension=redis.so

[root@linux-02 phpredis-develop]# /usr/local/php-fpm/bin/php -m |grep redis
redis
[root@linux-02 phpredis-develop]#  /etc/init.d/php-fpm restart

9.2 redis 存储session

学习笔记0714----NOSQL之redis_第1张图片

[root@linux-02 phpredis-develop]# vim /usr/local/php-fpm/etc/php-fpm.d/xihaji.conf

[test.com]
listen = /tmp/test.sock
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
request_slowlog_timeout = 2
slowlog = /usr/local/php-fpm/var/log/xihaji_slow.log
php_admin_value[open_basedir]=/data/wwwroot/test.com/:/tmp/
php_value[session.save_handler] = redis
php_value[session.save_path] = " tcp://192.168.174.129:6379 "

如果想用php连接redis cluster,需要使用predis扩展
安装方法类似phpredis,predis扩展地址https://github.com/nrk/predis

10. redis主从

为了节省资源,我们可以在一台机器上启动两个redis服务
cp /etc/redis.conf  /etc/redis2.conf
vim /etc/redis2.conf //需要修改port,dir,pidfile,logfile

port 6380
pidfile /var/run/redis_6380.pid
logfile "/var/log/redis2.log"
dir /data/redis2/

还要增加一行
slaveof 127.0.0.1 6379   是哪个redis的从,指定主是谁

如果主上设置了密码,还需要增加
masterauth tobe>com //设置主的密码

启动之前不要忘记创建新的dir目录
mkdir /data/redis2

redis-server /etc/redis2.conf
测试:在主上创建新的key,在从上查看
注意:redis主从和mysql主从不一样,redis主从不用事先同步数据,它会自动同步过去

11. redis集群

11.1 集群介绍

  • 多个redis节点网络互联,数据共享
  • 所有的节点都是一主一从(可以是多个从),其中从不提供服务,仅作为备用
  • 不支持同时处理多个键(如mset/mget),因为redis需要把键均匀分布在各个节点上,并发量很高的情况下同时创建键值会降低性能并导致不可预测的行为。
  • 支持在线增加、删除节点
  • 客户端可以连任何一个主节点进行读写
    学习笔记0714----NOSQL之redis_第2张图片

11.1 集群搭建场景

  • 场景设置:
  • 两台机器,分别开启三个Redis服务(端口)
  • A机器上三个端口7000,7002,7004,全部为主
  • B机器上三个端口7001,7003,7005,全部为从
  • 两台机器上都要编译安装redis,然后编辑并复制3个不同的redis.conf,分别设置不同的端口号、dir等参数,还需要增加cluster相关参数,然后分别启动6个redis服务

11.2 集群配置

ps:由于已经在129机器上已经redis编译过,可以直接把编译好的文件scp到128机器上,直接使用make install即可安装好redis

129机器上的配置文件如下:

[root@linux-02 etc]# cat /etc/redis_7000.conf
port 7000
bind 192.168.174.129
daemonize yes
pidfile /var/run/redis_7000.pid
dir /data/redis_data/7000
cluster-enabled yes
cluster-config-file nodes_7000.conf
cluster-node-timeout 10100
appendonly yes[root@linux-02 etc]# cat /etc/redis_7002.conf
port 7002
bind 192.168.174.129
daemonize yes
pidfile /var/run/redis_7000.pid
dir /data/redis_data/7002
cluster-enabled yes
cluster-config-file nodes_7002.conf
cluster-node-timeout 10100
appendonly yes[root@linux-02 etc]# cat /etc/redis_7004.conf
port 7004
bind 192.168.174.129
daemonize yes
pidfile /var/run/redis_7004.pid
dir /data/redis_data/7004
cluster-enabled yes
cluster-config-file nodes_7004.conf
cluster-node-timeout 10100
appendonly yes[root@linux-02 etc]#


[root@linux-02 etc]# mkdir -p /data/redis_data/7000
[root@linux-02 etc]# mkdir -p /data/redis_data/7002
[root@linux-02 etc]# mkdir -p /data/redis_data/7004


[root@linux-02 etc]# redis-server  /etc/redis_7000.conf
10406:C 17 Jul 2019 04:29:59.048 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10406:C 17 Jul 2019 04:29:59.048 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=10406, just started
10406:C 17 Jul 2019 04:29:59.048 # Configuration loaded
[root@linux-02 etc]# redis-server  /etc/redis_7002.conf
10411:C 17 Jul 2019 04:30:01.946 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10411:C 17 Jul 2019 04:30:01.946 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=10411, just started
10411:C 17 Jul 2019 04:30:01.946 # Configuration loaded
[root@linux-02 etc]# redis-server  /etc/redis_7004.conf
10416:C 17 Jul 2019 04:30:04.336 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10416:C 17 Jul 2019 04:30:04.336 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=10416, just started
10416:C 17 Jul 2019 04:30:04.336 # Configuration loaded
[root@linux-02 etc]# ps aux |grep redis-server
root      10189  0.1  1.3 163104 11360 ?        Ssl  03:49   0:03 redis-server 127.0.0.1:6379
root      10407  0.0  0.3 153892  2728 ?        Ssl  04:29   0:00 redis-server 192.168.174.129:7000 [cluster]
root      10412  0.0  0.8 153892  6776 ?        Ssl  04:30   0:00 redis-server 192.168.174.129:7002 [cluster]
root      10417  0.0  0.3 153892  2728 ?        Ssl  04:30   0:00 redis-server 192.168.174.129:7004 [cluster]
root      10424  0.0  0.1 112724   992 pts/0    R+   04:30   0:00 grep --color=auto redis-server

128机器上配置文件如下:

[root@linux-001 etc]# cat /etc/redis_7001.conf
port 7001
bind 192.168.174.128
daemonize yes
pidfile /var/run/redis_7001.pid
dir /data/redis_data/7001
cluster-enabled yes
cluster-config-file nodes_7001.conf
cluster-node-timeout 10100
appendonly yes[root@linux-001 etc]# cat /etc/redis_7003.conf
port 7003
bind 192.168.174.128
daemonize yes
pidfile /var/run/redis_7003.pid
dir /data/redis_data/7003
cluster-enabled yes
cluster-config-file nodes_7003.conf
cluster-node-timeout 10100
appendonly yes[root@linux-001 etc]# cat /etc/redis_7005.conf
port 7005
bind 192.168.174.128
daemonize yes
pidfile /var/run/redis_7005.pid
dir /data/redis_data/7005
cluster-enabled yes
cluster-config-file nodes_7005.conf
cluster-node-timeout 10100



[root@linux-001 etc]# mkdir -p /data/redis_data/7001
[root@linux-001 etc]# mkdir -p /data/redis_data/7003
[root@linux-001 etc]# mkdir -p /data/redis_data/7005


[root@linux-001 etc]# redis-server /etc/redis_7001.conf
7921:C 17 Jul 2019 04:29:25.816 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7921:C 17 Jul 2019 04:29:25.816 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=7921, just started
7921:C 17 Jul 2019 04:29:25.816 # Configuration loaded
[root@linux-001 etc]# redis-server /etc/redis_7003.conf
7933:C 17 Jul 2019 04:29:30.411 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7933:C 17 Jul 2019 04:29:30.411 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=7933, just started
7933:C 17 Jul 2019 04:29:30.411 # Configuration loaded
[root@linux-001 etc]# redis-server /etc/redis_7005.conf
7945:C 17 Jul 2019 04:29:33.244 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7945:C 17 Jul 2019 04:29:33.244 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=7945, just started
7945:C 17 Jul 2019 04:29:33.244 # Configuration loaded
[root@linux-001 etc]# ps aux |grep redis-server
root       7922  0.0  0.9 153892  7672 ?        Ssl  04:29   0:00 redis-server 192.168.174.128:7001 [cluster]
root       7934  0.0  0.5 153892  4744 ?        Ssl  04:29   0:00 redis-server 192.168.174.128:7003 [cluster]
root       7946  0.1  0.9 153892  7672 ?        Ssl  04:29   0:00 redis-server 192.168.174.128:7005 [cluster]
root       7963  0.0  0.1 112724   992 pts/0    R+   04:30   0:00 grep --color=auto redis-server

11.3 把ruby的源码包编译成rpm包

安装ruby2.2 (只需要一台机器上运行)
 yum -y groupinstall "Development Tools"
 yum -y install gdbm-devel libdb4-devel libffi-devel libyaml libyaml-devel ncurses-devel openssl-devel readline-devel tcl-deve
 cd /root/
 mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
 wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz -P rpmbuild/SOURCES
 wget https://raw.githubusercontent.com/tjinjin/automate-ruby-rpm/master/ruby22x.spec -P rpmbuild/SPECS
 rpmbuild -bb rpmbuild/SPECS/ruby22x.spec
 yum -y localinstall rpmbuild/RPMS/x86_64/ruby-2.2.3-1.el7.centos.x86_64.rpm
 gem install redis

11.4 集群配置操作

 cp /usr/local/src/redis-4.0.1/src/redis-trib.rb  /usr/bin/
 redis-trib.rb create --replicas 1 192.168.174.129:7000 192.168.174.129:7002 192.168.174.129:7004 192.168.174.128:7001 192.168.174.128:7003 192.168.174.128:7005
 redis-cli -c -h 192.168.174.129 -p 7000//-c说明以集群的方式登录
 任意一个节点都可以创建key,或者查看key(演示)
 redis-trib.rb check  192.168.174.129:7000//检测集群状态
 cluster nodes//列出节点
 cluster info//查看集群信息
 cluster meet ip port //添加节点
 cluster forget node_id //移除某个节点
 cluster replicate node_id//将当前节点设置为指定节点的从
 cluster saveconfig//保存配置文件

12. 扩展

扩展
redis 哨兵https://segmentfault.com/a/1190000002680804
http://www.cnblogs.com/jaycekon/p/6237562.html

你可能感兴趣的:(运维学习文档)