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

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


当前回答

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").

其他回答

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

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

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

下载redis 下载windows版的Redis

然后安装 以管理员权限打开CMD 执行命令net start redis

这是它。

在windows主机上运行Redis最简单的方法之一是使用Docker Redis容器。只需启动Hyper-V,下载Docker并运行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

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