Linux安装Redis

敢说敢作敢为, 无怨无恨无悔。这篇文章主要讲述Linux安装Redis相关的知识,希望能为你提供帮助。
1. 环境配置 1.1 Redis下载

Linux安装Redis

文章图片

1.2 C语言环境安装
2. 安装Redis 2.1 上传Redis
进入 redis-6.2.5 目录[root@localhost opt]# cd redis-6.2.5
查看 redis/redis-6.2.5/ 目录信息[root@localhost redis-6.2.5]# ls
![图片.png](https://s2.51cto.com/images/20210813/1628818757771748.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=) ![图片.png](https://s2.51cto.com/images/20210814/1628915973441849.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)### 2.2 安装 > 1. 编译 ```shell # 编译 [root@localhost redis-6.2.5]# make # 再次输入make命令检查 [root@localhost redis-6.2.5]# make

Linux安装Redis

文章图片

Linux安装Redis

文章图片

Linux安装Redis

文章图片

2.3 自定义配置
2.3.1 将Redis作为守护进程运行(后台运行)
Linux安装Redis

文章图片

2.3.2 允许Redis远程连接
Linux安装Redis

文章图片

2.3.3 过期事件通知发送
Linux安装Redis

文章图片

2.3.4 设置连接密码
Linux安装Redis

文章图片

3. 连接Redis4 设置开启启动
[root@localhost redis6_01]# vi /etc/rc.d/rc.local

Linux安装Redis

文章图片

#!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run \'chmod +x /etc/rc.d/rc.local\' to ensure # that this script will be executed during boot.touch /var/lock/subsys/local# redis开机启动 /opt/redis/redis6_01/bin/redis-server /opt/redis/redis6_01/redis.conf

# 查看文件默认权限 [root@localhost nginx_01]# ll /etc/rc.d/rc.local # 给文件赋予执行权限 [root@localhost nginx_01]# chmod +x /etc/rc.d/rc.local # 查看修改文件权限是否生效 [root@localhost nginx_01]# ll /etc/rc.d/rc.local

【Linux安装Redis】
Linux安装Redis

文章图片

5 删除加压缩文件

    推荐阅读