如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
如果你有Windows Linux子系统(WSL),本机在Windows 10和Windows Server 2019上,你可以这样做:
设置WSL:
To enable Windows Subsystem for Linux, follow the instructions on Microsoft Docs. The short version is: In Windows 10, Microsoft replaces Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL): Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Reboot Windows after making the change—note that you only need to do this one time. Download and install one of the supported Linux distros from the Microsoft Store. Ubuntu works fine. Note that Ubuntu 20.04 LTS may give you some trouble because of a known issue with the realtime clock (as of August 2020). Choosing Ubuntu 18.04 LTS instead avoids that issue.
安装和测试Redis:
Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use): > sudo apt-get update > sudo apt-get upgrade > sudo apt-get install redis-server > redis-cli -v Restart the Redis server to make sure it is running: > sudo service redis-server restart Execute a simple Redis command to verify your Redis server is running and available: $ redis-cli 127.0.0.1:6379> set user:1 "Oscar" 127.0.0.1:6379> get user:1 "Oscar" To stop your Redis server: > sudo service redis-server stop
来源:
https://redislabs.com/blog/redis-on-windows-10/
https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
其他回答
从历史上看,微软有一个redis的Windows移植版本,它以redis -64的形式发布,为Windows提供了一个完整的redis发行版。
微软的移植版本现在已被弃用,但已经出现了一些替代方案来填补这一空白:
Memurai是Redis-64弃用页面上官方推荐的替代方案;它是一个带有免费开发者层的商业产品,由Janea Systems维护 Redis-windows是另一个非官方的端口,它也存在
此版本包括Redis -server.exe (Memurai上的Memurai .exe)应用程序,在您的windows机器上运行Redis实例作为服务,以及Redis -cli.exe (Memurai上的Memurai -cli.exe),您可以使用它与任何Redis实例进行交互。
RGL存储库历史上被列为Redis的替代Windows端口,但这个存储库已经有一段时间没有维护了,并且实现了比微软端口更老的Redis版本。
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
转到发行版,你可以得到一个包含相关文件的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。
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)
我更新了在Windows 10上使用cygwin编译和运行redis 5的方式 https://github.com/meiry/redis5_compiled_for_windows10