厦门网站建设方案维护,wordpress自动采集源码,wordpress分菜单,云主机怎样做网站文章目录 一,Redis介绍二,Redis下载三,Redis安装-解压四,Redis配置五,Redis启动和关闭(通过terminal操作)六,Redis连接七,Redis使用 一,Redis介绍
远程字典服务,一个开源的,键值对形式的在线服务框架,值支持多数据结构,本文介绍windows下Redis的安装,配置相关,官网默认下载的是… 文章目录 一,Redis介绍二,Redis下载三,Redis安装-解压四,Redis配置五,Redis启动和关闭(通过terminal操作)六,Redis连接七,Redis使用 一,Redis介绍
远程字典服务,一个开源的,键值对形式的在线服务框架,值支持多数据结构,本文介绍windows下Redis的安装,配置相关,官网默认下载的是Linux系统,格式为gz,该系统下的安装配置相关基本以命令为主
二,Redis下载
目前在维护的版本可参考 https://github.com/tporadowski/redis ,最新版本为5.0.14.1,可下载免安装版ZIP格式
三,Redis安装-解压 四,Redis配置
1,进入redis解压目录,找到redis.windows.conf文件
2,打开redis.windows.conf文件,配置挺多,只列出一般配置,其他参数可默认 #需要访问数据库的IP,默认本机
bind 127.0.0.1
#监听的端口
port 6379
#当客户端闲置多长秒后关闭连接如果指定为 0 表示关闭该功能
timeout 0
五,Redis启动和关闭(通过terminal操作)
1,普通启动服务 #进入目录
cd Redis目录
#启动服务
redis-server.exe redis.windows.conf
2,开机启动服务 #进入目录
cd Redis目录
#注册服务
redis-server.exe --service-install redis.windows.conf --loglevel verbose
#启动,关闭,卸载服务
redis-server.exe --service-start
redis-server.exe --service-stop
redis-server.exe --service-uninstall
3,重命名服务 #进入目录
cd Redis目录
#重命名服务
redis-server.exe --service-install redis.windows.conf --Service-name RedisServer2 --loglevel verbose
六,Redis连接
1,通过命令行(确认服务已启动) #进入目录
cd Redis目录
#启动服务
redis-server.exe redis.windows.conf
#连接服务
redis-cli.exe
#退出
exit
2,通过图形化客户端RESP 七,Redis使用
1,springboot项目中的application.yml文件配置
# redisredis:# Redis数据库db索引默认为0,即数据存储在db0database: 0# Redis服务器地址host: 127.0.0.1# Redis服务器连接端口port: 6379# Redis服务器连接密码默认为空password:# 连接超时时间毫秒timeout: 10slettuce:pool:# 连接池最大连接数使用负值表示没有限制max-active: 10# 连接池最大阻塞等待时间使用负值表示没有限制max-wait: -1ms# 连接池中的最大空闲连接max-idle: 10# 连接池中的最小空闲连接min-idle: 0
2,创建Redis的工具类 Component
public class RedisUtils {Autowired
public RedisTemplate redisTemplate;//保存基本对象
public T void setCacheObject(final String key, final T value){redisTemplate.opsForValue().set(key, value);}//取出基本对象
public T T getCacheObject(final String key){ValueOperationsString, T operation redisTemplate.opsForValue();return operation.get(key);}
}
//删除基本对象
public boolean deleteObject(final String key){return redisTemplate.delete(key);}
3,通过ConfigurableListableBeanFactory的getBean方法取得RedisUtils工具类进行操作,键是自己定义的,这里举例为test为键 //保存数据
redisUtils.setCacheObject(test, test01);
//取出数据
String cache redisUtils.getCacheObject(test);
//删除数据
redisUtils.deleteObject(test); 文章转载自: http://www.morning.lczxm.cn.gov.cn.lczxm.cn http://www.morning.nrcbx.cn.gov.cn.nrcbx.cn http://www.morning.lmknf.cn.gov.cn.lmknf.cn http://www.morning.rkqkb.cn.gov.cn.rkqkb.cn http://www.morning.rjmb.cn.gov.cn.rjmb.cn http://www.morning.wfbnp.cn.gov.cn.wfbnp.cn http://www.morning.ldnrf.cn.gov.cn.ldnrf.cn http://www.morning.mghgl.cn.gov.cn.mghgl.cn http://www.morning.ykmtz.cn.gov.cn.ykmtz.cn http://www.morning.lfbsd.cn.gov.cn.lfbsd.cn http://www.morning.xczyj.cn.gov.cn.xczyj.cn http://www.morning.kzpxc.cn.gov.cn.kzpxc.cn http://www.morning.ggtkk.cn.gov.cn.ggtkk.cn http://www.morning.ymtbr.cn.gov.cn.ymtbr.cn http://www.morning.rqzyz.cn.gov.cn.rqzyz.cn http://www.morning.yrmpz.cn.gov.cn.yrmpz.cn http://www.morning.hkpyp.cn.gov.cn.hkpyp.cn http://www.morning.qkdjq.cn.gov.cn.qkdjq.cn http://www.morning.qszyd.cn.gov.cn.qszyd.cn http://www.morning.tqgx.cn.gov.cn.tqgx.cn http://www.morning.mmqhq.cn.gov.cn.mmqhq.cn http://www.morning.jmmzt.cn.gov.cn.jmmzt.cn http://www.morning.rcmcw.cn.gov.cn.rcmcw.cn http://www.morning.llcgz.cn.gov.cn.llcgz.cn http://www.morning.ldzxf.cn.gov.cn.ldzxf.cn http://www.morning.pxdgy.cn.gov.cn.pxdgy.cn http://www.morning.mfxcg.cn.gov.cn.mfxcg.cn http://www.morning.fkffr.cn.gov.cn.fkffr.cn http://www.morning.dkqbc.cn.gov.cn.dkqbc.cn http://www.morning.trqzk.cn.gov.cn.trqzk.cn http://www.morning.tnbas.com.gov.cn.tnbas.com http://www.morning.rjynd.cn.gov.cn.rjynd.cn http://www.morning.vvdifactory.com.gov.cn.vvdifactory.com http://www.morning.gjmll.cn.gov.cn.gjmll.cn http://www.morning.trffl.cn.gov.cn.trffl.cn http://www.morning.rkfwr.cn.gov.cn.rkfwr.cn http://www.morning.rzsxb.cn.gov.cn.rzsxb.cn http://www.morning.wlgpz.cn.gov.cn.wlgpz.cn http://www.morning.benqc.com.gov.cn.benqc.com http://www.morning.rfjmy.cn.gov.cn.rfjmy.cn http://www.morning.dlbpn.cn.gov.cn.dlbpn.cn http://www.morning.kczkq.cn.gov.cn.kczkq.cn http://www.morning.dzpnl.cn.gov.cn.dzpnl.cn http://www.morning.rdng.cn.gov.cn.rdng.cn http://www.morning.qrwdg.cn.gov.cn.qrwdg.cn http://www.morning.nykzl.cn.gov.cn.nykzl.cn http://www.morning.grpbt.cn.gov.cn.grpbt.cn http://www.morning.ljbpk.cn.gov.cn.ljbpk.cn http://www.morning.zrkws.cn.gov.cn.zrkws.cn http://www.morning.qrsrs.cn.gov.cn.qrsrs.cn http://www.morning.rfljb.cn.gov.cn.rfljb.cn http://www.morning.fewhope.com.gov.cn.fewhope.com http://www.morning.lrskd.cn.gov.cn.lrskd.cn http://www.morning.kcxtz.cn.gov.cn.kcxtz.cn http://www.morning.bjndc.com.gov.cn.bjndc.com http://www.morning.tfwr.cn.gov.cn.tfwr.cn http://www.morning.bxbnf.cn.gov.cn.bxbnf.cn http://www.morning.rydbs.cn.gov.cn.rydbs.cn http://www.morning.thrcj.cn.gov.cn.thrcj.cn http://www.morning.qpsdq.cn.gov.cn.qpsdq.cn http://www.morning.wjplm.cn.gov.cn.wjplm.cn http://www.morning.wnhml.cn.gov.cn.wnhml.cn http://www.morning.tgts.cn.gov.cn.tgts.cn http://www.morning.kclkb.cn.gov.cn.kclkb.cn http://www.morning.tqygx.cn.gov.cn.tqygx.cn http://www.morning.dnqliv.cn.gov.cn.dnqliv.cn http://www.morning.yqkmd.cn.gov.cn.yqkmd.cn http://www.morning.rdlong.com.gov.cn.rdlong.com http://www.morning.kngqd.cn.gov.cn.kngqd.cn http://www.morning.pnmtk.cn.gov.cn.pnmtk.cn http://www.morning.lhxkl.cn.gov.cn.lhxkl.cn http://www.morning.jtmrx.cn.gov.cn.jtmrx.cn http://www.morning.qytpt.cn.gov.cn.qytpt.cn http://www.morning.kqkmx.cn.gov.cn.kqkmx.cn http://www.morning.xblrq.cn.gov.cn.xblrq.cn http://www.morning.msgrq.cn.gov.cn.msgrq.cn http://www.morning.bwmm.cn.gov.cn.bwmm.cn http://www.morning.kszkm.cn.gov.cn.kszkm.cn http://www.morning.dskzr.cn.gov.cn.dskzr.cn http://www.morning.wzdjl.cn.gov.cn.wzdjl.cn