美文网首页
CentOS7安装Redis

CentOS7安装Redis

作者: 小辉哥08 | 来源:发表于2021-06-17 07:39 被阅读0次

1. 下载Redis

  • 浏览器打开Redis下载页,找到最新的稳定版redis-6.2.4.tar.gz。点击链接,开始下载
    redis download.png

2. 安装Redis

  • 上传下载好的压缩包到服务器的/tmp目录,并解压
cd /tmp
tar -zxvf redis-6.2.4.tar.gz
cd redis-6.2.4
make
make install PREFIX=/usr/local/redis
cp /tmp/redis-6.2.4/redis.conf /usr/local/redis/bin/
  • 修改 redis.conf 文件,把 daemonize no 改为 daemonize yes

    daemonize yes.png
  • 配置redis允许远程访问
    注释掉redis.conf文件中的bind属性设置,protected-mode属性设置no

    redis远程访问.png
  • 设置redis的访问密码

    requirepass.png
  • 启动redis

cd /usr/local/redis/bin
./redis-server redis.conf
  • 登录redis
cd /usr/local/redis/bin
./redis-cli -p 6379 -a 123456
redis-cli.png
  • 客户端工具Redis Desktop Manager连接Redis
    编辑设置.png
    Redis Desktop Manager.png

相关文章

网友评论

      本文标题:CentOS7安装Redis

      本文链接:https://www.haomeiwen.com/subject/hugaeltx.html