redis升级

服务器原来使用yum安装的。可以参考下面文章

Linux---Redis安装以及配置_yum安装redis-CSDN博客

yum安装的redis版本比较旧,我们直接下载源码编译安装。

我们下载已经发布的版本

Releases · redis/redis · GitHub

1、解压

2、make

3、make install

4、修改redis.conf

复制代码
log相关, logfile对应的文件所在的文件夹一定要创建,同时保证redis的运行用户,具有修改权限
# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
# nothing (nothing is logged)
loglevel verbose

# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
#logfile /var/log/redis/redis-server.log
logfile "" 

  
bind 可以访问的用户
#bind 127.0.0.1 -::1  注释掉就代表任何人都可以访问,这里可以做访问限制

requirepass 设置密码
requirepass xxxxx

5、使用systemctl启动

这需要配置启动文件

在/etc/systemd/system中创建redis.service

复制代码
[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
User=redis  
Group=redis  #删除User和Group代表由root用户启动
ExecStart=/usr/local/bin/redis-server /root/software/redis-7.4.1/redis.conf
ExecStop=/usr/local/bin/redis-cli -p 6379 shutdown
Restart=on-failure
Type=simple

[Install]
WantedBy=multi-user.target

可以使用下面命令进行操作

systemctl start redis

systemctl stop redis

systemctl status redis

systemctl enable redis 开机自启动

相关推荐
数澜悠客6 分钟前
AI规则引擎:解锁SQL数据分析新姿势
数据库·人工智能·oracle
懵逼的小黑子27 分钟前
飞书配置表数据同步到数据库中
数据库·飞书
Elastic 中国社区官方博客32 分钟前
在 Elasticsearch 中删除文档中的某个字段
大数据·数据库·elasticsearch·搜索引擎
杨凯凡38 分钟前
MySQL入门指南:环境搭建与服务管理全流程
数据库·mysql
时序数据说1 小时前
时序数据库IoTDB分布式系统监控基础概述
大数据·数据库·database·时序数据库·iotdb
虾球xz1 小时前
游戏引擎学习第278天:将实体存储移入世界区块
数据库·c++·学习·游戏引擎
forestsea2 小时前
MySQL 入门大全:数据类型
数据库·mysql
在未来等你2 小时前
互联网大厂Java求职面试:电商商品推荐系统中的AI技术应用
java·缓存·kafka·推荐系统·向量数据库·jvm调优·spring ai
为自己_带盐2 小时前
浅聊一下数据库的索引优化
开发语言·数据库·php
gb42152873 小时前
mysql数据库中某个数据表的碎片率自己降低了,mysql数据表对碎片率有自动优化机制吗?
数据库·mysql