首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Keepalived 实现 Redis AutoFailover (RedisHA)5

Keepalived 实现 Redis AutoFailover (RedisHA)5

作者头像
franket
发布于 2022-06-26 20:05:53
发布于 2022-06-26 20:05:53
4990
举报
文章被收录于专栏:技术杂记技术杂记

报错二

root@temp redis-3.0.4# pwd

/usr/local/src/redis-3.0.4

root@temp redis-3.0.4# make

cd src && make all

make1: Entering directory `/usr/local/src/redis-3.0.4/src'

代码语言:txt
复制
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"

make1: *** adlist.o Error 1

make1: Leaving directory `/usr/local/src/redis-3.0.4/src'

make: *** all Error 2

root@temp redis-3.0.4# echo $?

2

root@temp redis-3.0.4#

此问题是 Redis 默认会使用 jemalloc , 因为 jemalloc 被证明比 libc 有更少的碎片问题,但是我的系统中没有 jemalloc ,所以会出错

下面是来自源码中 README 的申明

Allocator


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:

代码语言:txt
复制
% make MALLOC=libc

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

代码语言:txt
复制
% make MALLOC=jemalloc

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档