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

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


当前回答

windows上的redis版本是由微软开放技术团队发布的,但最近这个项目已被归档为https://github.com/MicrosoftArchive/redis只读,不会更新。已经停止发展

其他回答

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

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

Redis下载页面现在有一些非官方Windows端口的链接。dmajkic似乎是最受欢迎/最完整的。

更详细的回答:如何在Windows下运行Redis服务

如果你对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服务

有两种方法。您可以使用MSI安装文件或手动执行:

首先下载msi或zip文件:

You can download both files from here:

https://github.com/MicrosoftArchive/redis/releases


观看视频教程(视频涵盖两种安装的示例)

查看这个安装视频教程:https://www.youtube.com/watch?v=ncFhlv-gBXQ

指导-对于不能YT工作的人:

你可以下载一个稍微过时的32位Redis预编译版本 以及64位Windows,感谢Dusan Majkic在他的GitHub页面:https://github.com/dmajkic/redis/downloads。现在就去做吧。

下载Redis之后,你需要从zip文件中提取可执行文件。 只要你使用的是比Windows XP更新的Windows版本,你就可以 应该能够提取Redis没有任何额外的软件。现在就开始吧。

当你提取了32位或64位版本的Redis到你的位置 选择(取决于您的平台和偏好;64位的Windows 可以运行32位或64位的Redis,但32位的Windows只能运行32位的Redis),你可以吗 通过双击Redis -server可执行文件启动Redis。在Redis 启动时,您应该看到一个类似于图a .1的窗口。

src: https://redis.com/ebook/appendix-a/a-3-installing-on-windows/a-3-2-installing-redis-on-window/

我在https://github.com/mythz/redis-windows上提供了在windows上运行Redis的2种最流行的安装说明和下载,展示了如何:

使用Vagrant运行最新的稳定版本的Redis VirtualBox虚拟机。 下载并运行微软Redis的原生Windows移植