如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
今天我知道这4个选择:
第一个是tporadowski/redis上的开源分支,提供了与版本5的兼容性(版本6正在开发中)。
第二个是memurai(付费),与版本5兼容,支持和一个免费版本的开发。
第三个是最近发布的zkteco-home/redis-windows,它提供了与版本7的兼容性,但不是开源的。
也可以选择通过WSL运行。但是我不建议在生产环境中使用它。
其他回答
读到一些用户在虚拟机中运行Redis,这让我想起了Redis团队的建议:
Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。
我认为这是在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。
由于mopentech的Redis端口不再维护-任何对Redis Windows本机端口感兴趣的人现在可以从这里获得4.0.14和5.0.10版本:https://github.com/tporadowski/redis/releases。 这个分叉是MSOpenTech的最新3.2.100版本和antirez/redis的4.0.14/5.0.10版本的合并,并修复了一些错误。
在windows主机上运行Redis最简单的方法之一是使用Docker Redis容器。只需启动Hyper-V,下载Docker并运行Redis
更新
如果你有Windows Linux子系统(WSL),本机在Windows 10和Windows Server 2019上,你可以按 Ogglas回答
或者按照这些说明在微软Windows上运行Redis数据库
Turn on Windows Subsystem for Linux In Windows 10, Microsoft replaced 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 once. Launch Microsoft Windows Store start ms-windows-store: Then search for Ubuntu, or your preferred distribution of Linux, and download the latest version. Install Redis server Installing Redis is simple and straightforward. The following example works with Ubuntu (you'll need to wait for initialization and create a login upon first use): sudo apt-add-repository ppa:redislabs/redis sudo apt-get update sudo apt-get upgrade sudo apt-get install redis-server Please note that the sudo command might or mightn't be required based on the user configuration of your system. Restart the Redis server Restart the Redis server as follows: sudo service redis-server restart Verify if your Redis server is running Use the redis-cli command to test connectivity to the Redis database. $ redis-cli 127.0.0.1:6379> set user:1 "Ben" 127.0.0.1:6379> get user:1 "Ben" Please note: By default, Redis has 0-15 indexes for databases, you can change that number of databases NUMBER in redis.conf. Stop the Redis Server sudo service redis-server stop
来源:如何在Windows上安装Redis
我找到了一个在Windows下安装Redis的更简单的方法
下载最新的Redis .msi文件
https://github.com/MSOpenTech/redis/releases
后安装。Redis服务已经安装,我们可以从服务管理器中操作它