安装Redis【Redis】

安装Redis

1.yum 安装 Redis

yum -y install redis

2. 启动 Redis

redis-server /etc/redis.conf &

3.操作 Redis

启动 redis 客户端:

redis-cli

在这里插入图片描述

4.设置远程链接

  1. 将 redis 配置文件下载到本地: redis 配置文件是 linux中 /etc/redis.conf
  2. 将 redis.conf 中的 “ bind 127.0.0.1 ” 注释掉;
  3. 将 redis.conf 中的 “ protected-mode yes ”改为 “ protected-mode no ”;
  4. 将修改后的 redis.conf 上传到 linux 的 /etc 目录;
  5. 使用命令 “ redis-cli shutdown ” 先关闭 redis 服务,再使用 “ redis-server /etc/redis/conf & ” 启动redis
  6. 云服务防火墙或者是安全策略中开发 redis 端口 6379在这里插入图片描述

注意:服务要开发访问的 redis 端口(默认6379).

猜你喜欢

转载自blog.csdn.net/weixin_53939785/article/details/129799462