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

相关推荐
隔窗听雨眠3 小时前
SQL执行计划固化的原理与稳定性工程
数据库·sql优化·执行计划
TDengine (老段)5 小时前
TDengine IDMP 功能点—数据接入
大数据·数据库·物联网·时序数据库·tdengine·涛思数据
索西引擎5 小时前
MySQL 进阶:视图、存储过程、存储函数与触发器
数据库·mysql
bksczm6 小时前
InnoDB 通用表空间与临时表空间详解
大数据·数据库·mysql
靠沿7 小时前
MySQL数据库进阶——存储过程和触发器
java·数据库·mysql
码少女7 小时前
MySQL--库与表的增删改查基础
java·数据库·mysql
Eyfcom8 小时前
〖物流 SaaS 实战 02〗SaaS 租户的计费与订阅模型:从“一锤子买卖”到“按需订阅”
linux·服务器·数据库·快递系统·物流saas实战
打工的小王8 小时前
postgresql和mysql对比
数据库·mysql·postgresql
数据库急诊室_阿哲9 小时前
一次割接后的性能复核记录:基线、样本、回滚点
运维·数据库·dba
保利威视频SaaS小张10 小时前
企业直播接入笔记 12|企业内训直播怎么做签到和学时统计,防挂机这件事比想象中难
java·前端·数据库·笔记·视频云·polvy·polyv