Ubuntu 编译安装 redis

这篇博客详细介绍了如何在Ubuntu系统中编译安装Redis。首先从官方网站下载Redis源码,接着解压并进行编译。成功编译后,依次启动Redis服务端和客户端。提供了多个参考资料作为辅助。

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

下载

http://download.redis.io/releases/

编译

解压 下载下来的源码压缩文件,然后编译

tar -zxvf redis-4.0.12.tar.gz
cd redis-4.0.12/
make

启动 redis 服务端

./src/redis-server redis.conf 

12332:C 31 Jan 19:32:23.575 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
12332:C 31 Jan 19:32:23.575 # Redis version=4.0.12, bits=64, commit=00000000, modified=0, pid=12332, just started
12332:C 31 Jan 19:32:23.575 # Configuration loaded
12332:M 31 Jan 19:32:23.575 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.12 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 12332
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

启动 redis 客户端

./src/redis-cli 

127.0.0.1:6379> 
127.0.0.1:6379> KEYS *
(empty list or set)
127.0.0.1:6379> 

参考链接:
https://redis.io/download
https://blog.youkuaiyun.com/Mikeoperfect/article/details/79468944
http://www.cnblogs.com/piaolingzxh/p/4199999.html
https://www.jianshu.com/p/86eee4c13645

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值