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 开机自启动

相关推荐
Elastic 中国社区官方博客1 分钟前
ES|QL 在 9.2:智能查找连接和时间序列支持
大数据·数据库·人工智能·sql·elasticsearch·搜索引擎·全文检索
q***016515 分钟前
PostgreSQL 17 发布了!非常稳定的版本
数据库·postgresql
菜鸟冲锋号19 分钟前
问题:增量关联(实时同步新数据) 这个场景中,如果hudi_pay 变更了一条数据,hudi_order_pay_join 结果的数据会跟着变化吗
服务器·前端·数据库
Wilson Chen39 分钟前
深入解剖 Redis Cluster:从 16384 分片原理到故障自动转移的硬核实战
数据库·redis·缓存
q***062940 分钟前
LangChain-08 Query SQL DB 通过GPT自动查询SQL
数据库·sql·langchain
一 乐42 分钟前
水果销售|基于springboot + vue水果商城系统(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·后端
霸王大陆43 分钟前
《零基础学PHP:从入门到实战》教程-模块七:MySQL 数据库基础-2
数据库·mysql·php
JIngJaneIL43 分钟前
校园任务平台|校园社区系统|基于java+vue的校园悬赏任务平台系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·校园任务平台
霸王大陆1 小时前
《零基础学PHP:从入门到实战》教程-模块七:MySQL 数据库基础-1
数据库·mysql·php
云半S一1 小时前
春招准备之Redis篇
数据库·经验分享·redis·笔记·缓存