对于redis安装的这个错误,我在博客redis 安装 与错误解决办法最后有提及,但是网上大部分文章的对这个问题的解答都是有误的。所以在这里单列出来。

错误内容:

jemalloc/jemalloc.h: No such file or directory。

文档

针对这个错误,我们可以在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 Verbose build
-------------

网上错误解决办法

网上大部分解决办法都是错误的,如下文:

(错误解决办法)

make MALLOC=libc

正确解决办法

正确解决办法(针对2.2以上的版本)

清理上次编译残留文件,重新编译

make distclean  && make

导致出现这个错误的原因

  错误的本质是我们在开始执行make 时遇到了错误(大部分是由于gcc未安装),然后我们安装好了gcc 后,我们再执行make ,这时就出现了jemalloc/jemalloc.h: No such file or directory。这是因为上次的

编译失败,有残留的文件,我们需要清理下,然后重新编译就可以了。

网上的解决办法是有什么错误吗?

  网上的解决办法虽然最后也是可以成功安装好 redis ,但是是有一些隐患的,首先我们要知道redis 需要使用内存分配器的, make MALLOC=jemalloc 就是指定内存分配器为 jemalloc ,make MALLOC=libc 就是指定内存分配器为 libc ,这个是有安全隐患的,jemalloc 内存分配器在实践中处理内存碎片是要比libc 好的,而且在README.md 文档也说明到了,jemalloc内存分配器也是包含在源码包里面的,可以在deps 目录下看到 jemalloc 目录。

redis 安装报错 jemalloc/jemalloc.h: No such file or directory。的更多相关文章

  1. Redis安装遇到的坑 stdlib.h: No such file or directory

    我使用的是ubuntu,本来这几天失业,心情不是很好,准备复习一下新的知识,可是自己在安装redis的过程中遇到了很多的问题. 或许自己很菜. 废话不多说,说一下我遇到的一个大坑. root@ufiv ...

  2. pip install urllib3[secure] 报错 error: ffi.h: No such file or directory

    解决 sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging pyt ...

  3. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

    参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such fil ...

  4. node 报错 env: node\r: No such file or directory

    最近在编写一个命令行工具.使用 npm link 时可以正常运行.但是 ctrl+s 保存后, 再运行则报错 env: node\r: No such file or directory ,需要再 n ...

  5. 使用nsenter进入docker容器后端报错 mesg: ttyname failed: No such file or directory

    通过nsenter 进入到docker容器的后端总是报下面的错,, [root@devdtt ~]# docker inspect -f {{.State.Pid}} mynginx411950 [r ...

  6. Centos 7.5源码编译安装zabbix4.0报fatal error: mysql.h: No such file or directory

    系统环境:CentOS 7.5是最小化安装的 编译信息 编译选项: root@Server01 zabbix-]# ./configure --prefix=/usr/share/applicatio ...

  7. laravel 报错SQLSTATE[HY000] [2002] No such file or directory

    在mac中执行php artisan migrate时报错 SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from i ...

  8. redis 安装报错

    CentOS 6.5 安装 Redis 执行 make #error "Newer version of jemalloc required" 根据你系统安装时或之后安装的选项的情 ...

  9. Ubuntu 14.04下Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”问题解决

    Redis简介: Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开发工 ...

随机推荐

  1. 1. Two Sum [Array] [Easy]

    Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...

  2. NotMapped属性特性

    NotMapped特性可以应用到领域类的属性中,Code-First默认的约定,是为所有带有get,和set属性选择器的属性创建数据列.. NotManpped特性打破了这个约定,你可以使用NotMa ...

  3. Unity3D中随机函数的应用

    电子游戏中玩家与系统进行互动的乐趣绝大多数取决于事件发生的不可预知性和随机性.在unity3D的API中提供了Random类来解决随机问题. 最简单的应用就是在数组中随机选择一个元素,使用Random ...

  4. SMINT:单页网站的免費jQuery插件

    最近为了做一个静态网页版的数据报告,不希望花很多时间去设计网页,或者花时间去调整布局,于是找到了一个名为Smint的免費jQuery插件.几乎不需要写什么代码就可以完成一个一页式网站.这非常适合用来制 ...

  5. 在Windows Server 2012 R2域环境中禁用(取消)密码复杂策略

    windows server 2012域环境默认启用密码复杂策略,例如: 至少有六个字符长,包含以下四类字符中的三类字符:英文大写字母(A 到 Z),英文小写字母(a 到 z),10 个基本数字(0 ...

  6. NLayerAppV3--.net Core2实现的DDD分层架构

    虽然每天的工作都是CURD.还是使用着传统的三层架构.使用着.net Framework,但是这并不能影响我学习DDD和.net core. 总是希望软件在应对复杂多变的场景时能够游刃有余,在解决问题 ...

  7. Kafka consumer的参数

    earliest: 当各分区下有已提交的offset时,从提交的offset开始消费:无提交的offset时,从头开始消费 latest :当各分区下有已提交的offset时,从提交的offset开始 ...

  8. windows下MySQL的安装(非安装包)

    命令代码 "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe" --install MySQL56_3308 --def ...

  9. POI2014 RAJ-Rally

    Description 给定一个\(N\)个点\(M\)条边的\(DAG(N,M\leq10^6)\),边权为\(1\).删去一个点,使剩余图中的最长路径最短,求删去的点和最长路径长度. Soluti ...

  10. Android之系统Action大全

    String ADD_SHORTCUT_ACTION 动作:在系统中添加一个快捷方式.. “android.intent.action.ADD_SHORTCUT” String ALL_APPS_AC ...