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

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


当前回答

如果你有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

其他回答

Redis项目并不正式支持Windows。但是,微软开放技术小组开发并维护了这个针对Win64的Windows端口。

http://redis.io/download

mssopentech - redis项目不再积极维护。如果你正在寻找Windows版本的Redis,你可能想看看Memurai。请注意,微软并没有以任何方式正式认可该产品。详情见https://github.com/microsoftarchive/redis

在Windows 10上安装和设置Redis服务器https://redislabs.com/blog/redis-on-windows-10

在macOS和Linux上安装和设置Redis服务器https://redis.io/download

此外,您可以通过包管理器在Linux上安装和设置Redis服务器

快速Redis服务器安装和设置指南macOS https://github.com/rahamath18/Redis-on-MacOS

you can install Redis by following this article: https://github.com/ServiceStack/redis-windows but for going straight, you can download it by this link: https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip after downloading, go to the directory which you like to put your files,then extract the zip file, then open a command prompt and go to the directory where you extracted your file, then type "redis-server" and hit enter(for opening redis-cli open command and route to redis directory, but instead of "redis-server" execute "redis-cli").

安装Redis for Windows

你可以从这些来源中任意选择

https://github.com/MSOpenTech/redis/releases 或 https://github.com/rgl/redis/downloads

就我个人而言,我更喜欢第一种选择

下载Redis-x64-2.8.2104.zip 解压到准备好的目录 运行redis-server.exe或redis-server.exe——maxheap 2gb

然后运行redis-cli.exe

您现在可以开始使用Redis,请参考命令

以下是我通过Windows子系统for Linux在Windows 10 Pro(1709)上安装Redis 4.0.8的步骤:

in home/user/
   01 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
   02 tar xzf redis-4.0.8.tar.gz
   03 cd redis-4.0.8/
   04 sudo apt-get install make
   05 sudo apt-get update
   06 sudo apt-get install gcc
   07 cd deps
   08 make hiredis jemalloc linenoise lua geohash-int
   09 cd ..
   10 make

如果您有一个最新的环境,您可以跳过几个步骤。