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

相关推荐
❀͜͡傀儡师1 小时前
多台服务器上docker部署 Redis 集群
运维·服务器·redis
银河金融数据库1 小时前
历史分钟高频数据
数据库·金融
男Ren、麦根1 小时前
MySQL 复制与主从架构(Master-Slave)
数据库·mysql·架构
Foyo Designer2 小时前
【 <二> 丹方改良:Spring 时代的 JavaWeb】之 Spring Boot 中的国际化:支持多语言的 RESTful API
java·spring boot·redis·后端·spring·缓存·restful
十六ᵛᵃᵉ3 小时前
day6_FlinkSQL实战
java·redis·ajax
嘉友3 小时前
Redis zset数据结构以及时间复杂度总结(源码)
数据结构·数据库·redis·后端
morganmin3 小时前
(一)MySQL常见疑惑之:select count(*)和select count(1)的区别
数据库·mysql
深圳厨神4 小时前
mysql对表,数据,索引的操作sql
数据库·sql·mysql
谁家有个大人4 小时前
数据分析问题思考路径
数据库·数据分析
hweiyu004 小时前
从JVM到分布式锁:高并发架构设计的六把密钥
jvm·redis·分布式·mysql·etcd