Windows下安装并设置Redis

本文介绍了Redis在Windows环境下的安装过程及配置方法,解决因磁盘空间不足导致的启动失败问题,并演示如何通过客户端连接及使用简单的命令验证安装成功。

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

转载:http://blog.youkuaiyun.com/renfufei/article/details/38474435

redis-benchmark.exe         #基准测试  
redis-check-aof.exe         # aof  
redis-check-dump.exe        # dump  
redis-cli.exe               # 客户端  
redis-server.exe            # 服务器  
redis.windows.conf          # 配置文件  

命令行

redis-server  redis.windows.conf  
D:\Develop\redis-2.8.12>redis-server.exe redis.windows.conf  
[7736] 10 Aug 21:39:42.974 #  
The Windows version of Redis allocates a large memory mapped file for sharing  
the heap with the forked process used in persistence operations. This file  
will be created in the current working directory or the directory specified by  
the 'dir' directive in the .conf file. Windows is reporting that there is  
insufficient disk space available for this file (Windows error 0x70).  
  
You may fix this problem by either reducing the size of the Redis heap with  
the --maxheap flag, or by starting redis from a working directory with  
sufficient space available for the Redis heap.  
  
Please see the documentation included with the binary distributions for more  
details on the --maxheap flag.  
  
Redis can not continue. Exiting. 

修改配置文件, 打开配置文件 redis.windows.conf ,搜索 maxheap 

.......  
#    
# maxheap <bytes>  
maxheap 1024000000  
....... 

重新启动

D:\Develop\redis-2.8.12>redis-server  redis.windows.conf  
                _._  
           _.-``__ ''-._  
      _.-``    `.  `_.  ''-._           Redis 2.8.12 (00000000/0) 64 bit  
  .-`` .-```.  ```\/    _.,_ ''-._  
 (    '      ,       .-`  | `,    )     Running in stand alone mode  
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379  
 |    `-._   `._    /     _.-'    |     PID: 6736  
  `-._    `-._  `-./  _.-'    _.-'  
 |`-._`-._    `-.__.-'    _.-'_.-'|  
 |    `-._`-._        _.-'_.-'    |           http://redis.io  
  `-._    `-._`-.__.-'_.-'    _.-'  
 |`-._`-._    `-.__.-'    _.-'_.-'|  
 |    `-._`-._        _.-'_.-'    |  
  `-._    `-._`-.__.-'_.-'    _.-'  
      `-._    `-.__.-'    _.-'  
          `-._        _.-'  
              `-.__.-'  
  
[6736] 10 Aug 22:01:22.247 # Server started, Redis version 2.8.12  
[6736] 10 Aug 22:01:22.248 * The server is now ready to accept connections on port 6379  

双击打开 redis-cli.exe , 如果不报错,则连接上了本地服务器,然后测试,比如 set命令,get命令:

127.0.0.1:6379> set tiemao http://blog.youkuaiyun.com/renfufei  
OK  
127.0.0.1:6379> get tiemao  
"http://blog.youkuaiyun.com/renfufei"  
127.0.0.1:6379> 
可以了






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值