目录
附:为什么使用这个命令make MALLOC=libc?而不是直接make
附:如果服务器中没有安装gcc,那么在执行make的时候会报以下错误
一、Linux下安装Redis
mkdir redis
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar xzvf redis-5.0.5.tar.gz
cd redis-5.0.5
make MALLOC=libc
vi /opt/software/redis/redis-5.0.5/redis.conf
./redis-server ../redis.conf
./redis-cli ping
附:为什么使用这个命令make MALLOC=libc?而不是直接make
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:
To compile against jemalloc on Mac OS X systems, use:
说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
附:如果服务器中没有安装gcc,那么在执行make的时候会报以下错误
二、Windows下安装Redis
https://github.com/ServiceStack/redis-windows/tree/master/downloads