redis 在 windows 中的安装
redis 在 windows 中的安装
redis 官方并没有提供 redis 的 windows 版本。但是微软提供了 redis 的 windows 版本。有2.8和3.0版本。3.0版本支持集群。
微软提供的redis的windows版本地址
https://github.com/microsoftarchive/redis/releases

下载后解压

启动
# 指定配置文件
D:\chengxu\redis-3.0.504-x64>redis-server redis.windows.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.504 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 10072
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[10072] 19 Oct 20:51:38.828 # Server started, Redis version 3.0.504
[10072] 19 Oct 20:51:38.832 * The server is now ready to accept connections on port 6379
# 双击redis-cli.exe 打开客户端成功
127.0.0.1:6379> set foo 1
OK
设置服务
Windows Service Documentation.docx 文档中有描述。
安装服务
# 默认服务名为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-install redis.windows-service.conf --loglevel verbose
# 指定服务名为Redis3.0 端口号为6381
D:\chengxu\redis-3.0.504-x64>redis-server --service-install redis.windows.conf --loglevel verbose --port 6381 --service-name Redis3.0
[12912] 19 Oct 21:04:45.014 # Granting read/write access to 'NT AUTHORITY\NetworkService' on: "D:\chengxu\redis-3.0.504-x64" "D:\chengxu\redis-3.0.504-x64\"
[12912] 19 Oct 21:04:45.014 # Redis successfully installed as a service.
卸载服务
# 不指定服务名,使用默认服务名redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall
[17268] 19 Oct 21:17:29.102 # Redis service successfully uninstalled
# 卸载前先停止服务
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall --service-name redis3.0
[17476] 19 Oct 21:17:50.561 # Redis service successfully uninstalled.
停止服务
# 服务名称如果不指定默认为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-stop --service-name redis3.0
[12360] 19 Oct 21:23:08.044 # Redis service successfully stopped.
启动服务
# 服务名称如果不指定默认为redis。如果服务已经启动,再次执行会报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-start --service-name redis3.0
[16536] 19 Oct 21:24:08.587 # Redis service successfully started.
客户端连接
D:\chengxu\redis-3.0.504-x64>redis-cli --help
redis-cli 3.0.504
Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
-h <hostname> Server hostname (default: 127.0.0.1).
-p <port> Server port (default: 6379).
-s <socket> Server socket (overrides hostname and port).
-a <password> Password to use when connecting to the server.
实战
D:\chengxu\redis-3.0.504-x64>redis-cli -h localhost -p 6381
localhost:6381> get foo
(nil)
localhost:6381> set foo 1
OK
localhost:6381> exit
bugs
# 没有指定配置文件,将会使用默认的配置。而且是需要密码的,但是我们并不知道密码。
D:\chengxu\redis-3.0.504-x64>redis-server
[1460] 19 Oct 20:31:59.351 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[1460] 19 Oct 20:31:59.353 # Creating Server TCP listening socket *:6379: bind: No such file or directory
D:\chengxu\redis-3.0.504-x64>netstat -ano |findstr 6379
TCP 0.0.0.0:6379 0.0.0.0:0 LISTENING 5188
TCP [::]:6379 [::]:0 LISTENING 5188
# 打开客户端,没有认证
127.0.0.1:6379> get foo
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth redis
(error) ERR invalid password
127.0.0.1:6379>
# 先停止服务再卸载服务。不然报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall --service-name redis3.0
[14972] 19 Oct 21:18:09.837 # HandleServiceCommands: system error caught. error code=1072, message = DeleteService failed: unknown error
# 如果服务已经启动,执行启动命令将报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-start --service-name redis3.0
[7304] 19 Oct 21:24:21.685 # HandleServiceCommands: system error caught. error code=1056, message = StartService failed: unknown error
# 找到不到服务名则报错。默认为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-stop
[4412] 19 Oct 21:22:47.868 # HandleServiceCommands: system error caught. error code=1060, message = OpenService failed: unknown error
redis 在 windows 中的安装的更多相关文章
- redis在windows中的安装
之前介绍过了redis的相关知识,以及在linux平台上安装redis,为了方便学习,这里记录一下redis在windows平台上的安装步骤 1.下载redis下载地址https://github.c ...
- 下载文件时-修改文件名字 Redis在Windows中安装方法 SVN安装和使用(简单版) WinForm-SQL查询避免UI卡死 Asp.Net MVC Https设置
下载文件时-修改文件名字 1后台代码 /// <summary> /// 文件下载2 /// </summary> /// <param name="Fil ...
- Redis for Windows(C#缓存)安装和使用
Redis for Windows(C#缓存)安装和使用 前言 前段时间写过两篇简单的有关Memcached缓存的相关文章,当然了只是入门的如何使用而已.最近这两天又发现了Redis这个神奇的东西,之 ...
- Appium+Robotframework实现Android应用的自动化测试-1:Appium在Windows中的安装
让我们开始在Windows中开始安装Appium吧,Appium在OS X中的具体安装后面的文章会介绍. 另外,官网上说先要装Node.js,还要装Apache Ant和Apache Maven,Gi ...
- windows中配置安装mysql数据库
MySql 是一种免费的关系型数据库,相较于 MsSqlServer 和 Oracle 比较轻量化,安装也很简单,而且免费不需要的版权费用,个人认为一般的小项目采用还是比较合适的,当然也有部分数据量很 ...
- ElasticSearch之Windows中环境安装
ElasticSearch 说明 本章,我们主要以在 Windows 中对ElasticSearch 安装进行介绍! 1. 下载 ElasticSearch 这里我们下载的版本为7.17.4为例进行介 ...
- Redis在Windows中安装方法
首先下载Redis 下载地址:https://github.com/MSOpenTech/redis/releases Redis支持32位和64位,这个需要根据你系统平台的实际情况选择,我的是64位 ...
- NoSQL和Redis简介及Redis在Windows下的安装和使用教程
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/103.html?1455869099 NoSQL简介 介绍redis前,我 ...
- Redis在Windows下的安装和使用
NoSQL简介 介绍redis前,我想还是先认识下NoSQL,即not only sql, 是一种非关系型的数据存储,key/value键值对存储.现有Nosql DB 产品: Redis/Mongo ...
随机推荐
- 快读&快写模板【附O2优化】
快读&快写模板 快读快写,顾名思义,就是提升输入和输出的速度.在这里简单介绍一下几种输入输出的优劣. C++ cin/cout 输入输出:优点是读入的时候不用管数据类型,也就是说不用背scan ...
- Asp.Net Core 工作单元 UnitOfWork UOW
Asp.Net Core 工作单元示例 来自 ABP UOW 去除所有无用特性 代码下载 : 去除所有无用特性版本,原生AspNetCore实现 差不多 2278 行代码: 链接:https://pa ...
- IPv6 地址生命周期
在preferred time和valid lifetime之间叫做deprecated 状态,当地址达到这个时间段的时候,地址不能主动的发起连接只能是被动的接受连接,过了valid lifetime ...
- Kubernetes集群的安全机制
集群的安全性需要考虑以下几个目标: 1.保证容器与其所在宿主机的隔离 2.限制容器给基础设施及其他容器带来的消极影响的能力 3.最小权限原则——合理限制所有组件的权限,确保组件只执行它被授权的行为 4 ...
- 原生js实现append()方法
一.在使用jquery时,append() 方法在被选元素的结尾(仍然在内部)插入指定内容 使用方法:$(selector).append(content),content为必需的.规定要插入的内容( ...
- Visual Studio 定制模板类---详细步骤
1.先定义一个类文件,将要定义的信息写入类文件 比如我每次写一个命令都是这个套路,要继承接口,要写上相应的特性,每次都 是重复的工作: 2.提取类模板 项目=>导出模板 这里你可以导出项目模板和 ...
- linux部署java命令
启动: #!/bin/bash source /etc/profile log() { echo `date +[%Y-%m-%d" "%H:%M:%S]` $1 } log &q ...
- StringBuilder.sb.AppendLine();
StringBuilder sb=new StringBuilder(); sb.AppendLine("The world is fair and wonderful.Everything ...
- netcore sdk版本选择
NetCore sdk并不是每个版本都支持VS2017工具,也不是每个版本的sdk版本号和Runtime版本号都一样,这就需要我们在创建某个版本的net core应用时注意: 使用不同版本的vs时需要 ...
- Python - 列表 - 第八天
Python 列表 序列是Python中最基本的数据结构.序列中的每个元素都分配一个数字 - 它的位置,或索引,第一个索引是0,第二个索引是1,依此类推. Python有6个序列的内置类型,但最常见的 ...