centos 7安装redis5

环境

centos 7 最简安装

官网指导地址:https://redis.io/download

1、yum 安装wget

# yum install -y wget

2、安装gcc

yum install -y gcc

3、下载并安装redis 5

# wget http://download.redis.io/releases/redis-5.0.3.tar.gz
# tar xzf redis-5.0.3.tar.gz
# cd redis-5.0.3
# make MALLOC=libc

关于分配器allocator, 如果有MALLOC  这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数
 
(
4、启动服务
src/redis-server
 
5、启动客户端
src/redis-cli
)
 
###以后台进程方式启动redis
修改redis.conf文件  daemonize no  =====>yes
 
指定redis.conf文件启动   ./redis-server ...../redis.conf
 
#####关闭redis进程
 
 
 
 

猜你喜欢

转载自www.cnblogs.com/hougang/p/redis.html