如何在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服务
其他回答
目前还没有windows版的Redis。(只有一些旧版本可用)
但是你可以使用WSL(Windows Subsystem for Linux)安装最新版本,参考以下来自Redis Labs的博客:
https://redislabs.com/blog/redis-on-windows-10
在这里可以找到最新的Redis版本(后面只有几个小版本)。这个存储库为您提供了3.2.100版本(当前是3.2),而投票最多的答案只提供了2.4.6版本,最后一次更新是在2年前。
安装很简单:只需将存档中的所有内容复制到任何文件夹中,然后运行redis-server.exe来运行服务器,再运行redis-cli.exe通过shell连接到该服务器。
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
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
我认为这是在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。