如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。

我可以在Windows上本地运行Redis吗?


当前回答

你可以试试baboonstack,它包括redis和node.js以及mongoDB版本管理器。它是跨平台的。

其他回答

读到一些用户在虚拟机中运行Redis,这让我想起了Redis团队的建议:

Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。

在Windows系统上安装Redis遵循以下步骤:

访问以下链接之一:

https://github.com/MSOpenTech/redis/releases(推荐) https://github.com/rgl/redis/downloads

下载MSI文件。 按照安装向导在您的系统上安装该程序。(不要更改安装路径为“C:\Program Files\Redis”) 在开始菜单上搜索“编辑系统环境变量” 点击“环境变量”按钮 选择“路径”,点击“编辑” 现在点击“新建” 粘贴C:\Program Files\Redis(如果在安装时更改了路径) 点击“ok”,“ok”和“ok”

现在打开终端(命令提示符)并运行redis-cli

好吧,我得到一些错误打开redis-server(它一直工作得很好,直到现在,但不确定什么是错误的,所以弄清楚并将更新这个答案)

如果你对Powershell有点满意,你也可以使用Powershell和chocoley得到最新的Windows二进制文件。

首先,按照下面的说明(一个简单的命令行,如admin)将chocolatey添加到Powershell: https://chocolatey.org/

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

然后,使用Powershell从chocolatey获取redis包:http://chocolatey.org/packages/redis-64

choco install redis-64

Redis将被安装在C:\ProgramData\chocolatey\lib\ Redis -64.2.8.9这样的目录中

Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All rights reserved. PS C:\windows\system32> choco install redis-64 Chocolatey (v0.9.8.27) is installing 'redis-64' and dependencies. By installing you accept the license for 'redis-64' an d each dependency you are installing. redis-64 v2.8.9 Added C:\ProgramData\chocolatey\bin\redis-benchmark.exe shim pointed to '..\lib\redis-64.2.8.9\redis-benchmark.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-aof.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-aof.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-dump.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-dump.exe'. Added C:\ProgramData\chocolatey\bin\redis-cli.exe shim pointed to '..\lib\redis-64.2.8.9\redis-cli.exe'. Added C:\ProgramData\chocolatey\bin\redis-server.exe shim pointed to '..\lib\redis-64.2.8.9\redis-server.exe'. Finished installing 'redis-64' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure

然后运行服务器

redis-server

或者使用CLI

redis-cli

按照C:\ProgramData\chocolatey\lib\redis-64.2.8.9\RedisService.docx中的说明安装redis服务

MS Open Tech最近在Github上提供了一个Redis版本供下载。他们说它还没有准备好生产,但请密切关注。

Github回购

下载发行版为MSIs

我正在使用Memurai,这是redis兼容的缓存和Windows的数据存储。微软开放技术也推荐它,因为它写在他们以前的项目这里。

这个项目不再被积极维护。如果你是 寻找Windows版本的Redis,你可能想看看 Memurai。请注意,微软并没有正式认可这一点 任何形式的产品。