redis安裝中遇到的問題

1.錯誤描述:

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 `/data0/src/redis-2.6.2/src'
make: *** [all] Error 2

緣由分析

在README 有這個一段話。linux

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:  
 
    % make MALLOC=libc  
 
To compile against jemalloc on Mac OS X systems, use:  
 
    % make MALLOC=jemallocredis


說關於分配器allocator, 若是有MALLOC  這個 環境變量, 會有用這個環境變量的 去創建Redis。ui

並且libc 並非默認的 分配器, 默認的是 jemalloc, 由於 jemalloc 被證實 有更少的 fragmentation problems 比libc。spa

可是若是你又沒有jemalloc 而只有 libc 固然 make 出錯。 因此加這麼一個參數。.net

解決辦法

1.make MALLOC=libcunix

2.更新jemalloc,參考http://blog.csdn.net/xiaofei_hah0000/article/details/52214592code

 

2.錯誤描述:

You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1

解決辦法:blog

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz  
sudo tar xzvf tcl8.6.1-src.tar.gz  -C /usr/local/  
cd  /usr/local/tcl8.6.1/unix/  
sudo ./configure  
sudo make  
sudo make install

3get

相關文章
相關標籤/搜索