redis 在linux下安装步骤

本文介绍如何下载并安装 Redis 4.0.9 版本,包括配置修改使得 Redis 能够在后台运行,并提供启动后的验证方法及查找配置文件位置的指令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

$ wget http://download.redis.io/releases/redis-4.0.9.tar.gz
$ tar xzf redis-4.0.9.tar.gz
$ cd redis-4.0.9
$ make

$ src/redis-server
src/redis-cli

启动的时候出现 WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or

需打开redis.conf 找到daemonize,把后面的no 改成yes,意思是让redis在后台启动

然后输入命令 ps -ef|grep redis,结果如下:

root     24761     1  0 14:19 ?        00:00:00 src/redis-server 127.0.0.1:6379

root     24767 20999  0 14:19 pts/0    00:00:00 grep --color=auto redis

说明已经启动

find / -name redis.conf  查看redis所在的安装目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值