redis配置

1、Redis报错:ERR Operation against a key holding the wrong kind of value 解决处理

redis 127.0.0.1:6379>type key

查找key的数据类型,使用对应的命令进行操作

在线命令说明: http://doc.redisfans.com/

redis安装列表: https://github.com/rgl/redis/downloads

Redis工具使用:  https://github.com/uglide/RedisDesktopManager/wiki/Quick-Start

Redis学习手册(List数据类型) :  http://www.cnblogs.com/stephen-liu74/archive/2012/02/14/2351859.html

2、常用命令

2.1. 连接redis服务器

>进入redis目录

>redis-cli.exe -h 127.0.0.1 -p 6379

2.2. 关闭服务

>shutdown

2.3. 开启多个实例

> redis-server.exe redis.conf

但是配置中需要加入:slaveof 127.0.0.16379

2.4. 开机启动redis

sc.exe create redis6379 binPath= ""D: edis edis-server.exe" "D: edis edis6379.conf"" DisplayName= "redis6379" start= "auto"

clipboard

解决方法:

redis.vbs

createobject("wscript.shell").run "D:dev edis-2.4.5start.bat",0

之后,把 start.bat 放在redis-2.4.5目录下,把redis.vbs放在启动目录下

clipboard[1]

start.bat

D:

D:dev edis-2.4.5

redis-server.exe redis.conf

3、StackExchange.Redis

System.Diagnostics.Process.Start("D:\redis\redis-server.exe"); 启动redis服务

4、持久化存储

配置


2
3
4
5
save 9001
save 30010
save 6010000
dbfilename dump.rdb
dir /opt/soft/redis-3.0.4/cache

注:dir 指的的是工作目录,而不是exe文件所在目录,即cmd进入的目录

http://qifuguang.me/2015/10/13/Redis%E6%8C%81%E4%B9%85%E5%8C%96/

>> 问题1:redis2.8无法启动

clipboard[2]

分       析:redis觉得你的内存不够,不给开启实例,可以配置maxheap来修改

解决方法:

在redis.windows.confi文件中增加 “maxheap 1024000”

然后在使用命令启动redis:redis-server redis.windows.conf


原文地址:https://www.cnblogs.com/smallidea/p/5454022.html