如何在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。
其他回答
安装 Redis
窗户
⚫Windows 8.1及以前版本
Download Redis (msi) from the link https://github.com/MicrosoftArchive/redis/releases Run the installer Open the folder where Redis has been installed and Start redis-server to check if redis is working by clicking on redis-server Stop Redis server by typing SHUTDOWN SAVE or force quit by CTRL + C Open Start Type Environment Variables and click on edit environment variables and path Inside System variables, click on path In the next window click on new. Add a new path C:\Program Files\{Your Redis Version} Where Redis Version is the Redis version installed on your system For e.g. C:\Program Files\Redis-x64-3.2.100 Verify That Setup was Successful Check by typing redis-cli or redis-server
⚫ 视窗 10
Step Up WSL
a.以Administrator用户运行Windows Powershell
b.执行以下命令
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
c.修改完成后重新启动Windows
d.从windows商店https://www.microsoft.com/en-us/p/ubuntu-1804/9n9tngvndl3q?activetab=pivot%3Aoverviewtab下载Ubuntu发行版
安装和测试Redis
a.启动下载的发行版,执行如下命令
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
redis-cli -v
注:如果安装有任何错误,请参阅本文。
如果你有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
在windows主机上运行Redis最简单的方法之一是使用Docker Redis容器。只需启动Hyper-V,下载Docker并运行Redis
读到一些用户在虚拟机中运行Redis,这让我想起了Redis团队的建议:
Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。
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)