以 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