Centos7 编译安装 Redis 4.0.6

下载Redis 4.0

wget http://download.redis.io/releases/redis-4.0.6.tar.gz
可以根据需要的版本修改
http://download.redis.io/releases/redis-'版本号'.tar.gz
#/bin/bash
# 本文使用 Docker Centos7 镜像 作为基础环境
docker pull centos:centos7.7.1908

编译安装 Redis4.0

#/bin/bash
# 编译安装Redis 4.0.6
yum -y install gcc gcc-c++ libstdc++-devel tcl make wget
wget http://download.redis.io/releases/redis-4.0.6.tar.gz
tar -xf redis-4.0.6.tar.gz && cd redis-4.0.6
make && make PREFIX=/usr/local/redis/ install
mkdir /usr/local/redis/conf
mv $PWD/redis.conf $PWD/sentinel.conf /usr/local/redis/conf

启动 Redis4.0

# 修改为 Redis 配置,后台启动
vi /root/redis.conf
daemonize no > daemonize yes
# 启动 Redis 服务
/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf
# 查看 Redis 服务进程
ps -axu | grep redis
# 连接 Redis 是否成功开启
[root@5960e31a5411 redis-4.0.6]# /usr/local/redis/bin/redis-cli 
127.0.0.1:6379> ping
PONG
posted @ 2021-10-10 22:15  运维之爪  阅读(94)  评论(0编辑  收藏  举报