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

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


当前回答

在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(它一直工作得很好,直到现在,但不确定什么是错误的,所以弄清楚并将更新这个答案)

其他回答

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

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

从历史上看,微软有一个redis的Windows移植版本,它以redis -64的形式发布,为Windows提供了一个完整的redis发行版。

微软的移植版本现在已被弃用,但已经出现了一些替代方案来填补这一空白:

Memurai是Redis-64弃用页面上官方推荐的替代方案;它是一个带有免费开发者层的商业产品,由Janea Systems维护 Redis-windows是另一个非官方的端口,它也存在


此版本包括Redis -server.exe (Memurai上的Memurai .exe)应用程序,在您的windows机器上运行Redis实例作为服务,以及Redis -cli.exe (Memurai上的Memurai -cli.exe),您可以使用它与任何Redis实例进行交互。

RGL存储库历史上被列为Redis的替代Windows端口,但这个存储库已经有一段时间没有维护了,并且实现了比微软端口更老的Redis版本。

You can use Memurai for Windows, a Redis-compatible cache and datastore for Windows, currently compatible with Redis 5. Memurai aims to fulfill the need for a supported Redis-compatible datastore on the Windows platform. At its core, it’s based on Redis source code, ported to run natively on Windows, and it’s designed to provide the level of reliability and performance required for production environments. Memurai is free for development and testing. You can learn more and download Memurai at https://www.memurai.com.

亚历克西斯Campailla CEO, Memurai

您可以使用Windows子系统for Linux(a.k.)在Windows 10上安装Redis。WSL2)。WSL2是一个兼容层,用于在Windows 10和Windows Server 2019上本机运行Linux二进制可执行文件。WSL2允许开发人员直接在Windows上运行GNU/Linux环境(包括命令行工具、实用程序和应用程序)。

按照下面的链接在微软Windows 10上创建Redis数据库https://developer.redislabs.com/create/windows

如果你有Windows Linux子系统(WSL),本机在Windows 10和Windows Server 2019上,你可以这样做:

设置WSL:

To enable Windows Subsystem for Linux, follow the instructions on Microsoft Docs. The short version is: In Windows 10, Microsoft replaces Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL): Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Reboot Windows after making the change—note that you only need to do this one time. Download and install one of the supported Linux distros from the Microsoft Store. Ubuntu works fine. Note that Ubuntu 20.04 LTS may give you some trouble because of a known issue with the realtime clock (as of August 2020). Choosing Ubuntu 18.04 LTS instead avoids that issue.

安装和测试Redis:

Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use): > sudo apt-get update > sudo apt-get upgrade > sudo apt-get install redis-server > redis-cli -v Restart the Redis server to make sure it is running: > sudo service redis-server restart Execute a simple Redis command to verify your Redis server is running and available: $ redis-cli 127.0.0.1:6379> set user:1 "Oscar" 127.0.0.1:6379> get user:1 "Oscar" To stop your Redis server: > sudo service redis-server stop

来源:

https://redislabs.com/blog/redis-on-windows-10/

https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux