1、下载redis 地址 http://download.redis.io/releases/redis-5.0.2.tar.gz

2、解压tar -zxf redis-5.0.2.tar.gz

3、缺少gcc环境需要yum install gcc -y

3.1 make编译

3.2 报错:

[root@lang redis-5.0.2]# make
cd src && make all
make[1]: Entering directory `/usr/local/redis-4.0.10/src'
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-4.0.10/src'
make: *** [all] Error 2

redis解压目录下有个README.md文件中有如下一段话:

Selecting a non-default memory allocator when building Redis is done by setting the `MALLOC` environment variable. Redis is compiled and linked against libc malloc by default, with the exception of jemalloc being the default on Linux systems. This default was picked because jemalloc has proven to have fewer fragmentation problems than libc malloc.

To force compiling against libc malloc, use:

% make MALLOC=libc

To compile against jemalloc on Mac OS X systems, use:

% make MALLOC=jemalloc

4、编译加上MALLOC=libc 即可

   #make MALLOC=libc

5、运行redis

修改配置文件 redis.conf

daemonize no 改为 yes 后台运行:

protected-mode yes 改为no 可以不用输入密码登陆

daemonize yes 改为no

requirepass "xiaoqi@Redis" 这里可以设置自己想要设置的密码/默认是加#的,去掉即可

bind 127.0.0.1  表示只可以本机访问,要是远程访问需要注释掉(前面加#号即可)

6、带配置文件后台启动

[root@lang redis-5.0.2]# src/redis-server redis.conf 
7897:C 06 Dec 2018 06:25:57.484 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7897:C 06 Dec 2018 06:25:57.484 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=7897, just started
7897:C 06 Dec 2018 06:25:57.484 # Configuration loaded
[root@lang redis-5.0.2]# ps -ef | grep redis
root       7898      1  4 06:25 ?        00:00:00 src/redis-server *:6379    
root       7903   2880  0 06:25 pts/1    00:00:00 grep redis
[root@lang redis-5.0.2]#src/redis-clt 127.0.0.1 #可以测试是否可以本地进入redis

最新文章

  1. MVC4做网站后台:栏目管理3、删除栏目与左侧列表菜单
  2. Charles 如何抓取https数据包
  3. java 内部类 *** 最爱那水货
  4. ASP.NET MVC 快速开发框架之 SqlSugar+SyntacticSugar+JQWidgetsSugar+jqwidgets
  5. Apache kafka原理与特性(0.8V)
  6. Qt之QHeaderView自定义排序(终极版)
  7. Java最重要的21个技术点和知识点之JAVA多线程、时间处理、数据格式
  8. http协议Authorization认证方式在Android开发中的使用
  9. HTTP协议中返回代码302的情况
  10. CLR_Via_C#学习笔记之枚举
  11. Easyui设置动态表格,动态导出数据实例,附Dome
  12. awk命令练习
  13. svn 迁移至git操作手册
  14. Node.js创建服务器和模拟客户端请求
  15. 误用WeakHashMap引起的死循环cpu跑满问题
  16. Hibernate入门(十)inverse
  17. JS事件(一)事件流&事件处理程序
  18. LevelDB源码分析-Get
  19. systemtap 脚本示例
  20. JavaScript RegExp Object 正则表达式入门

热门文章

  1. Spring Boot程序的执行流程
  2. 20155219付颖卓《网络对抗》Exp6 信息搜集与漏洞扫描
  3. 20155219付颖卓 Exp3 免杀原理与实践
  4. Python练习一
  5. CSAPP HITICS 大作业 hello's P2P by zsz
  6. kali在执行 apt-get update 命令时报错的解决方法
  7. Deloyment Descriptor web.xml
  8. [工作积累] shadow map问题汇总
  9. WebService之客户端
  10. 如何开发一款html5(H5)跨平台 k12动画/交互课件/游戏