如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
以下是我通过Windows子系统for Linux在Windows 10 Pro(1709)上安装Redis 4.0.8的步骤:
in home/user/
01 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
02 tar xzf redis-4.0.8.tar.gz
03 cd redis-4.0.8/
04 sudo apt-get install make
05 sudo apt-get update
06 sudo apt-get install gcc
07 cd deps
08 make hiredis jemalloc linenoise lua geohash-int
09 cd ..
10 make
如果您有一个最新的环境,您可以跳过几个步骤。
其他回答
似乎这是获得最新版本的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
目前还没有windows版的Redis。(只有一些旧版本可用)
但是你可以使用WSL(Windows Subsystem for Linux)安装最新版本,参考以下来自Redis Labs的博客:
https://redislabs.com/blog/redis-on-windows-10
我更新了在Windows 10上使用cygwin编译和运行redis 5的方式 https://github.com/meiry/redis5_compiled_for_windows10
读到一些用户在虚拟机中运行Redis,这让我想起了Redis团队的建议:
Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。
更新
如果你有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服务已经安装,我们可以从服务管理器中操作它