如何在 Windows 上运行 Redis?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6476945/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I run Redis on Windows?
提问by DaveHeller
How do I run Redis on Windows? The Redis download page just seems to offer *nix options.
如何在 Windows 上运行 Redis?Redis 下载页面似乎只提供 *nix 选项。
Can I run Redis natively on Windows?
我可以在 Windows 上本地运行 Redis 吗?
回答by serg
One click Redis install as a Windows service:
一键将Redis安装为Windows服务:
https://github.com/rgl/redis/downloads
https://github.com/rgl/redis/downloads
Download and run the top .exe (ignore the "download as zip" button)
下载并运行最上面的 .exe(忽略“下载为 zip”按钮)
Edit:For the latest versions of Redis for Windows look at MSOpenTech/redis
. See Todd Menier's answerfor more information.
编辑:有关 Windows 版 Redis 的最新版本,请查看MSOpenTech/redis
. 有关更多信息,请参阅Todd Menier 的回答。
回答by zangw
I found one more simple way to install Redis
under Windows
我找到了一种更简单的Redis
在 Windows 下安装的方法
Download the latest Redis
.msi
file from
Redis
.msi
从下载最新文件
https://github.com/MSOpenTech/redis/releases
https://github.com/MSOpenTech/redis/releases
after installation. The redis service is installed, we can operate it from Service manager
安装后。安装了redis服务,我们可以从Service manager
回答by Todd Menier
If you want to install MSOpenTech's latest port of Redis, on a Windows server, watched over by a Windows Service, without having to build anything yourself, read on.
如果您想在 Windows 服务器上安装 MSOpenTech 的最新 Redis 端口,由 Windows 服务监视,而无需自己构建任何东西,请继续阅读。
MSOpenTech'sseems to be the only port that is actively trying to keep up with the latest and greatest Redis. They claim it is production-ready, but they haven't exactly packaged it up neatly for installation on a server, especially if you want to run their RedisWatcherservice to keep an eye on it, which is recommended. (I tried building RedisWatcher myself per their instructions, but the required Wix Toolset managed to mess up my system pretty good. I won't go into it.) Fortunately they've provided all the binaries you need, just not all in one place. From the README:
MSOpenTech似乎是唯一一个积极尝试跟上最新最好的 Redis 的端口。他们声称它是生产就绪的,但他们还没有完全打包好安装在服务器上,特别是如果你想运行他们的RedisWatcher服务来密切关注它,这是推荐的。(我尝试按照他们的指示自己构建 RedisWatcher,但所需的 Wix 工具集设法把我的系统搞得一团糟。我不会深入研究它。)幸运的是,他们提供了您需要的所有二进制文件,只是不是全部在一个地方. 从自述文件:
So far the RedisWatcher is not carried over to 2.6. However this should not be affected by the Redis version, and the code in the 2.4 branch should work with the Redis 2.6 binaries.
到目前为止,RedisWatcher 还没有延续到 2.6。但是,这不应受 Redis 版本的影响,并且 2.4 分支中的代码应该适用于 Redis 2.6 二进制文件。
So you'll need to download binaries from 2 branches in order to get all the necessary bits. Without further ado, here are the steps:
因此,您需要从 2 个分支下载二进制文件才能获得所有必要的位。闲话少说,下面是步骤:
- Download and extract the Redis binaries from the 2.6 branch
- Copy all extracted binaries to c:\redis\bin
- Create another folder at c:\redis\inst1
- Download and extract the RedisWatcher binaries from the 2.4 branch
- Run InstallWatcher.msi. This should create a Windows service called Redis watcher.
- Open up the Windows Services console and start the Redis watcher service.
- (optional) RedisWatcher should have installed to C:\Program Files (x86)\RedisWatcher. There you'll find a config file called watcher.conf, which you can edit to set up additional instances, use different paths than I specified in steps 2 & 3, etc. You will not need to restart the service for changes to take effect.
- 从 2.6 分支下载并解压Redis 二进制文件
- 将所有提取的二进制文件复制到 c:\redis\bin
- 在 c:\redis\inst1 创建另一个文件夹
- 从 2.4 分支下载并解压RedisWatcher 二进制文件
- 运行 InstallWatcher.msi。这应该创建一个名为 Redis watcher 的 Windows 服务。
- 打开 Windows 服务控制台并启动 Redis 观察程序服务。
- (可选)RedisWatcher 应该已安装到 C:\Program Files (x86)\RedisWatcher。在那里你会找到一个名为 watcher.conf 的配置文件,你可以编辑它来设置额外的实例,使用不同于我在步骤 2 和 3 中指定的路径等。你不需要重新启动服务以使更改生效.
回答by Salvador Dali
The most updated (only few minor releases behind) version of Redis can be found here. This repository provides you with 3.2.100 version (current is 3.2) whereas the most upvoted answergives you only 2.4.6 version and the last update to the repo was 2 years ago.
Redis 的最新版本(只有少数几个小版本落后)可以在这里找到。此存储库为您提供 3.2.100 版本(当前为 3.2),而最受好评的答案仅提供 2.4.6 版本,并且该存储库的最后一次更新是 2 年前。
The installation is straightforward: just copy everything from the archive to any folder and run redis-server.exeto run the server and redis-cli.exeto connect to this server through the shell.
安装很简单:只需将存档中的所有内容复制到任何文件夹,然后运行redis-server.exe来运行服务器,然后运行redis-cli.exe以通过 shell 连接到该服务器。
回答by Cristiana Chavez
To install Redis for Windows
为 Windows 安装 Redis
You can choose either from these sources
您可以从这些来源中进行选择
Personally I preferred the firstoption
我个人更喜欢第一个选项
- Download Redis-x64-2.8.2104.zip
Extract the zip to prepared directory
run
redis-server.exe
orredis-server.exe --maxheap 2gb
- 下载Redis-x64-2.8.2104.zip
将 zip 解压缩到准备好的目录
运行
redis-server.exe
或redis-server.exe --maxheap 2gb
- then run
redis-cli.exe
- 然后运行
redis-cli.exe
You can start using Redis now, please refer for commands
现在就可以开始使用Redis了,具体命令请参考
回答by awebartisan
Maybe its a little Late but, I was able to run Redis on Windows 10 Aniversary Update.
Windows 10 Aniversary Update Comes with Bash on Ubuntu on Windows, simply, it comes with bash.
Below are the two tutorial that I followed:
1- How to Install and Use the Linux Bash Shell on Windows 10
2- How To Install and Use Redis
Below is the image of running Redis.
Enjoy :)
也许有点晚了,但是我能够在 Windows 10 Aniversary Update 上运行 Redis。
Windows 10 Aniversary Update在 Windows 上的 Ubuntu 上随附Bash,简单地说,它随附 bash。
以下是我遵循的两个教程:
1-如何在 Windows 10 上安装和使用 Linux Bash Shell
2-如何安装和使用 Redis
下面是运行 Redis 的图像。
享受 :)
回答by bbrown
Go to the releasesand you can get a ZIP file containing the relevant files as well asa Word document called RedisService.docx
with the following instructions:
转到发布,您可以获得包含相关文件的 ZIP 文件以及RedisService.docx
使用以下说明调用的 Word 文档:
Installing the Service
--service-install
This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit. This command does not start the service.
For instance:
redis-server --service-install redis.windows.conf --loglevel verbose
安装服务
--服务安装
这必须是 redis-server 命令行上的第一个参数。此后的参数按照它们在服务启动时出现在 Redis 的顺序传递。该服务将被配置为自动启动,并将作为“NT AUTHORITY\NetworkService”启动。成功安装后,将显示一条成功消息,Redis 将退出。此命令不会启动服务。
例如:
redis-server --service-install redis.windows.conf --loglevel 详细
And then later, in the same document, another example:
然后,在同一个文档中,另一个例子:
The following would install and start three separate instances of Redis as a service:
redis-server --service-install -–service-name redisService1 –port 10001
redis-server --service-start --service-name redisService1
redis-server --service-install --service-name redisService2 –port 10002
redis-server --service-start --service-name redisService2
redis-server --service-install --service-name redisService3 –port 10003
redis-server --service-start --service-name redisService3
以下将安装和启动三个独立的 Redis 实例作为服务:
redis-server --service-install --service-name redisService1 --port 10001
redis-server --service-start --service-name redisService1
redis-server --service-install --service-name redisService2 --port 10002
redis-server --service-start --service-name redisService2
redis-server --service-install --service-name redisService3 --port 10003
redis-server --service-start --service-name redisService3
From what I can gather, this appears to be the new way forward rather than messing with a separate Windows service to monitor and restart the CLI.
据我所知,这似乎是一种新的前进方式,而不是使用单独的 Windows 服务来监视和重新启动 CLI。
回答by Guru
Download redis from Download Redis for windows
从下载 Redis for windows下载 redis
- Then install it
- open cmd with admin rights
- run command
net start redis
- 然后安装它
- 用管理员权限打开cmd
- 运行命令
net start redis
Thats it.
就是这样。
回答by JesseBuesking
MS Open Tech recently made a version of Redis available for download on Github. They say that it isn't production ready yet, but keep an eye on it.
MS Open Tech 最近在 Github 上提供了一个可供下载的 Redis 版本。他们说它还没有准备好生产,但请密切关注它。
回答by DevWL
There are two ways. You can use MSI installation file or do it manually:
有两种方法。您可以使用 MSI 安装文件或手动安装:
First download the msi or the zip file:
首先下载 msi 或 zip 文件:
您可以从这里下载这两个文件: https://github.com/MicrosoftArchive/redis/releaseshttps://github.com/MicrosoftArchive/redis/releasesWatch video tutorial (video covers example of both installations)
观看视频教程(视频涵盖了两种安装的示例)
see this installation video tutorial:
https://www.youtube.com/watch?v=ncFhlv-gBXQ
请参阅此安装视频教程:https:
//www.youtube.com/watch?v=ncFhlv-gBXQ