如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在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/
Redis下载页面现在有一些非官方Windows端口的链接。dmajkic似乎是最受欢迎/最完整的。
更详细的回答:如何在Windows下运行Redis服务
我认为这是在Windows上运行Redis的两种最简单的方法
1 -本地(更新)端口的Windows
如选项3所述,运行微软的Redis本机端口:
下载redis原生64位Windows端口redis-latest.zip wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip 解压redis64-latest.zip到任何文件夹,例如在c:\redis 使用本地配置运行redis-server.exe cd c: \复述 redis-server.exe redis.conf 运行redis-cli.exe连接到你的redis实例 cd c: \复述 redis-cli.exe
2 -与流浪者
你可以在Windows上用Vagrant使用Redis,如下所述:
在Windows上安装Vagrant 下载vagrant-redis.zip vagrant配置文件 wget https://raw.github.com/ServiceStack/redis-windows/master/downloads/vagrant-redis.zip 将vagrant-redis.zip解压到任意文件夹,例如c:\vagrant-redis 使用vagrant启动Virtual Box VM: cd c: \ vagrant-redis 流浪汉了 这会在Virtual Box中启动一个新的Ubuntu VM实例 自动安装并启动最新的稳定版本的redis。
摘自:http://avenshteinohad.blogspot.com/2016/01/redis-jedis-quickstart.html
如果您使用windows,请使用MSOpenTech版本: https://github.com/MSOpenTech/redis
你可能还会发现这篇文章对入门基本命令很有用。
读到一些用户在虚拟机中运行Redis,这让我想起了Redis团队的建议:
Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。