说明:redis的缩写是REmote DIctionary Server。它是最流行的开源,高级key-value存储系统。这里说下CentOS 7上安装redis服务器方法。
项目地址:http://redis.io/
安装
1、安装EPEL
#CentOS/RHEL 6:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
#CentOS/RHEL 7:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
2、安装Redis服务器
1、yum安装redis服务器
yum install redis
两个重要的redis服务器配置文件的路径/etc/redis.conf和/etc/redis-sentinel.conf。
2、启动redis服务器
#CentOS 6
service redis start
#CentOS 7
systemctl start redis.service
3、检查redis服务器的运行状态
#CentOS 6
service redis status
#CentOS 7
systemctl status redis.service
4、测试Redis的安装
redis-cli ping如果返回结果PONG,则安装成功。
3、redis服务器相关命令
#CentOS 6系统
chkconfig redis on #开机自启
service redis stop #停止redis服务器
service redis restart #重新启动redis服务器
#CentOS 7系统
systemctl stop redis.service #停止redis服务器
systemctl restart redis.service #重新启动redis服务器
systemctl enable redis.service #开机启动redis服务器
systemctl disable redis.service #开机禁用redis服务器
4、Redis服务器监听端口Redis Server默认侦听端口号6379,可使用SS命令查看。
ss -nlp|grep redis
学习Redis请看:http://redis.io/documentation
最后修改:2019 年 03 月 05 日 05 : 00 PM
此处评论已关闭