Centos7 安装配置 redis 3
Centos7 安装配置 redis 3
操作方法
- 01
安装EPEL源 以64位为例 # wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm # rpm -ivh epel-release-7-8.noarch.rpm
- 02
方法一:使用命令安装 安装redis: # yum -y install redis 启动/停止/重启 Redis启动服务 : # systemctl start redis.service停止服务 : # systemctl stop redis.service重启服务: # systemctl restart redis.service检查状态: # systemctl status redis.service 随系统启动服务: # systemctl enable redis.service 关闭随机启动: # systemctl disable redis.service
- 03
方法二:编译安装 下载安装编译: # wget http://download.redis.io/releases/redis-3.2.3.tar.gz # tar xzf redis-3.2.3.tar.gz # cd redis-3.2.3 # make # make install 设置配置文件路径 # mkdir -p /etc/redis && cp redis.conf /etc/redis 修改配置文件:# vim /etc/redis/redis.conf 修改为: daemonize yes 启动Redis: # /usr/local/bin/redis-server /etc/redis/redis.conf #关闭服务# redis-cli shutdown 或者在cli中执行shutdown# redis 127.0.0.1:6379> shutdown 清除缓存# redis-cli flushall 查看状态 :# ss -nlp|grep redis或者# ps -ef | grep redis