• 欢迎访问爱玩吧
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏爱玩吧

[教程]CentOS 6/7安装Redis服务器教程

实用教程 aiwanyule 3年前 (2021-05-12) 已收录
文章目录[隐藏]

说明: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


爱玩吧 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:[教程]CentOS 6/7安装Redis服务器教程
喜欢 (0)