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

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

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

说明:redis的缩写是REmote DIctionary Server。它是最流行的开源,高级key-value存储系统。这里说下CentOS 7上安装redis服务器方法。

项目地址:http://redis.io/

安装

1、安装EPEL

  1. #CentOS/RHEL 6:
  2. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
  3. #CentOS/RHEL 7:
  4. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

2、安装Redis服务器
1、yum安装redis服务器

  1. yum install redis

两个重要的redis服务器配置文件的路径/etc/redis.conf/etc/redis-sentinel.conf

2、启动redis服务器

  1. #CentOS 6
  2. service redis start
  3. #CentOS 7
  4. systemctl start redis.service

3、检查redis服务器的运行状态

  1. #CentOS 6
  2. service redis status
  3. #CentOS 7
  4. systemctl status redis.service

4、测试Redis的安装

  1. redis-cli ping

如果返回结果PONG,则安装成功。

3、redis服务器相关命令

  1. #CentOS 6系统
  2. chkconfig redis on #开机自启
  3. service redis stop #停止redis服务器
  4. service redis restart #重新启动redis服务器
  5. #CentOS 7系统
  6. systemctl stop redis.service #停止redis服务器
  7. systemctl restart redis.service #重新启动redis服务器
  8. systemctl enable redis.service #开机启动redis服务器
  9. systemctl disable redis.service #开机禁用redis服务器

4、Redis服务器监听端口
Redis Server默认侦听端口号6379,可使用SS命令查看。

  1. ss -nlp|grep redis

学习Redis请看:http://redis.io/documentation


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