在Windows上安装Redis

微软官网源码 https://github.com/MicrosoftArchive/redis

这里介绍安装Signed binaries版本

使用Chocolatey(Windows包管理工具)安装

官方安装说明 https://chocolatey.org/install

两种方法

  • 在Cmd命令中键入
@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"
  • 在PowerShell命令中输入
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

安装Redis

官方安装说明 https://chocolatey.org/packages/redis-64/

在命令中键入

choco install redis-64

默认安装目录 C:ProgramDatachocolateylib edis-64。安装目录中有相关介绍文档《Redis on Windows.docx》、《Redis on Windows Release Notes》、《Windows Service Documentation.docx》

在Windows服务中运行Redis

参考安装目录中的文档《Windows Service Documentation.docx》

安装到Windows服务

在当前目录命令中键入

redis-server --service-install redis.windows.conf

以读取配置文件 redis.windows.conf ,中包括端口号(port 端口号)、授权秘钥(requirepass 秘钥)等

启动服务

在当前目录命令中键入

redis-server --service-start

 本文地址:https://www.cnblogs.com/smartstar/p/10844743.html

原文地址:https://www.cnblogs.com/smartstar/p/10844743.html