CentOS 使用 yum 安装 Redis

安装命令

以 CentOS 7.x 为例

yum install redis
复制

管理命令

CentOS 7.0 以下版本将 systemctl start redis 换成 service redis strat 即可

# 启动 redis 服务
systemctl start redis
# 停止 redis 服务
systemctl start redis
# 查看 redis 状态
systemctl status redis
复制

开机启动

# centOS 7 
systemctl enable redis
# centOS 6 
chkconfig redis on
复制

测试命令

redis-cli
set name lesscode
get name