如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
转到发行版,你可以得到一个包含相关文件的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实例作为服务: 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
据我所知,这似乎是一种新的方法,而不是用一个单独的Windows服务来监视和重新启动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服务
如果你想在Windows服务器上安装mopentech最新的Redis端口,由Windows Service监视,而不需要自己构建任何东西,请继续阅读。
MSOpenTech's seems 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 RedisWatcher service 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:
到目前为止,RedisWatcher还没有延续到2.6版本。然而,这 不应该受到Redis版本和2.4中的代码的影响 分支应该与Redis 2.6二进制文件一起工作。
因此,您需要从两个分支下载二进制文件,以获得所有必要的位。话不多说,下面是步骤:
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.
VARY EASY:(NO ANY CAMMAN OR NOT GOING TO ANY LINK,ONLY FOLLOW THIS STEP ,FOR ALL VERSION)
FIRST INSTALL REDIS
-->>AFTER OPEN TASKBAR
-->>OPEN SERVICE(taskbar service)
-->>CHOOSE REDIS
-->>RIGTH CLICK ON REDIS SERVICE AND OPEN SERVICE(VIEW IMAGES)
-->>CLICK ON START OR RESTART.(ALSO SET AUTOSTART)
我正在使用Memurai,这是redis兼容的缓存和Windows的数据存储。微软开放技术也推荐它,因为它写在他们以前的项目这里。
这个项目不再被积极维护。如果你是 寻找Windows版本的Redis,你可能想看看 Memurai。请注意,微软并没有正式认可这一点 任何形式的产品。
似乎这是获得最新版本的Redis最简单的方法-使用NuGet管理器:
1)打开NuGet设置页面,下载命令行实用程序 (nuget.exe命令行工具的最新版本始终可从https://nuget.org/nuget.exe获得)
2)将此文件复制到某个地方(例如C:\Downloads)
3)以管理员身份启动命令提示符并执行以下命令:
cd C:\Downloads
nuget.exe install redis-64
4)在下载文件夹将是最新版本的Redis (C:\Downloads\Redis-64.2.8.19在我的情况下)
5)运行redis-server.exe并开始工作
附注:下载的redis for windows包含一个非常旧的redis版本:2.4.6