当前位置:网站首页>Linux CentOS8安装Redis6
Linux CentOS8安装Redis6
2022-08-02 05:07:00 【OMUQUK】
1. 安装make构建工具
yum install make
如果报错:
2. 下载新版本redis发行版
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
3. 解压构建
tar -xzf redis-6.2.6.tar.gz
cd redis-6.2.6
make
构建成功后生成src目录

4. 配置环境变量
1.编辑/etc/profile文件,将src目录配置为环境变量
vim /etc/profile
2.最下面加入如下配置(export PATH=$PATH:/安装的路径/redis-6.2.6/src)
export PATH=$PATH:/root/redis/redis-6.2.6/src
3.加载配置文件
source /etc/profile
5. 注册系统服务到redis
1.修改utils目录下的install_server.sh文件(vim /安装的路径/redis-6.2.6/utils/install_server.sh)
vim /root/redis/redis-6.2.6/utils/install_server.sh
注释76-83行左右代码

2.执行install_server.sh脚本安装redis服务
cd /
安装的路径/redis-6.2.6/utils
./install_server.sh
输入端口、日志文件、配置文件等或者回车默认
最后一行输入src目录下redis-server的路径

6. 安装完成
启动redis服务
systemctl start redis_6379
停止redis服务
systemctl stop redis_6379
7. 设置可远程访问
1.修改配置文件
vim /etc/redis/6379.conf
2.注释bind 127.0.0.1 -::1这一行

3.protected-mode改为no

- 保存后重启redis服务
systemctl restart redis_6379
8.防火墙配置:
查看6379端口号是否已经开启
firewall-cmd --query-port=6379/tcp开启6379端口号
firewall-cmd --zone=public --add-port=6379/tcp --permanent刷新(重新加载端口号)
firewall-cmd --reload查看6379端口号是否已经开启
firewall-cmd --query-port=6379/tcp
编辑防火墙配置文件:
vim etc/sysconfig/iptables-config
添加如下:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT
重启redis:
redis-server redis.windows.conf
边栏推荐
- Packaging and deployment of go projects
- MySQL 用户授权
- Timing task library in the language use Cron, rounding
- [PSQL] 函数、谓词、CASE表达式、集合运算
- ELK log analysis system
- 为什么4个字节的float要比8个字节的long大呢?
- Navicat cannot connect to mysql super detailed processing method
- MySQL 8.0.28 version installation and configuration method graphic tutorial
- MySQL 8.0.29 set and modify the default password
- Detailed explanation of mysql stored procedure
猜你喜欢
随机推荐
[PSQL] 函数、谓词、CASE表达式、集合运算
为什么4个字节的float要比8个字节的long大呢?
Detailed installation and configuration of golang environment
构造方法、成员变量、局部变量
Navicat cannot connect to mysql super detailed processing method
21 Day Learning Challenge Schedule
Android studio connects to MySQL and completes simple login and registration functions
Detailed explanation of the software testing process (mind map) of the first-tier manufacturers
整合ssm(一)
面试官:设计“抖音”直播功能测试用例吧
51单片机外设篇:ADC
MySQL 8.0.28 version installation and configuration method graphic tutorial
What do interview test engineers usually ask?The test supervisor tells you
mysql 8.0.28版本安装配置方法图文教程
51单片机外设篇:红外通信
coredns介绍
apisix-入门使用篇
利用浏览器本地存储 实现记住用户名的功能
Packaging and deployment of go projects
How H5 realizes evoking APP









