windows下安装并启动redis服务
2015-07-08 16:36
246 查看
有时候客户环境是windows系统,但是我们的项目又用redis,那么就需要下载windows版本的redis来安装使用。
下载地址: http://redis.io/download
下载解压后,打开Windows Service Documentation.docx,里面有详细的命令:
安装服务:
redis-server --service-install redis.windows.conf--loglevel verbose
卸载服务:
redis-server --service-uninstall
启动服务:
redis-server.exe --service-start
停止服务:
redis-server.exe --service-stop
关于启动服务这一步,有可能会报错:
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
出现这个错误,多半是由于没有在conf文件中配置maxheap导致。
在redis.windows.conf中找到 # maxheap <bytes>,在下面添加配置 maxheap xxxxxx
再启动,如果报no such file or directory, 则应该是没有创建heap文件的目录:
heapdir D:/temp/redis_heapdir/
创建目录即可。
另:建议按照文档指令来操作,否则可能会出现各种奇怪问题,比如启动报错、停止报错,但是实际上已经起来(停止)了。
下载地址: http://redis.io/download
下载解压后,打开Windows Service Documentation.docx,里面有详细的命令:
安装服务:
redis-server --service-install redis.windows.conf--loglevel verbose
卸载服务:
redis-server --service-uninstall
启动服务:
redis-server.exe --service-start
停止服务:
redis-server.exe --service-stop
关于启动服务这一步,有可能会报错:
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
出现这个错误,多半是由于没有在conf文件中配置maxheap导致。
在redis.windows.conf中找到 # maxheap <bytes>,在下面添加配置 maxheap xxxxxx
再启动,如果报no such file or directory, 则应该是没有创建heap文件的目录:
heapdir D:/temp/redis_heapdir/
创建目录即可。
另:建议按照文档指令来操作,否则可能会出现各种奇怪问题,比如启动报错、停止报错,但是实际上已经起来(停止)了。
相关文章推荐
- Redis基础命令
- redis缓存的安装和使用
- Sentinel redis集群配置
- redis单机安装
- 三千万数据量下redis2.4的一统计情况
- Keepalived+nginx+redis主从+tomcat一机多实例实现会话共享
- Redis-博文功能实现
- Redis主从配置及通过Keepalived实现Redis自动切换高可用
- Redis sort 排序命令详解
- php-redis中的sort排序函数总结
- redis---批量插入数据
- 使用Spring Cache + Redis + Jackson Serializer缓存数据库查询结果中序列化问题的解决
- NOSQL数据库Redis原理以及初学步骤
- redis持久化RDB和AOF
- Redis高可用安装笔记
- php-redis中的sort排序函数总结
- Redis安装教程
- redis-cli 命令总结
- redis命令参考(五) Hashes
- redis命令参考(四) set集合