![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
redis
wangc_gogo
一个标点符号一篇博客,也是一种进步!!!
展开
-
lua + redis 实现动态ip黑名单
lua_shared_dict shared_ip_blacklist 1m; #定义ip_blacklist 本地缓存变量location /ipblacklist { access_by_lua_file /usr/local/lua/access_by_limit_ip.lua; echo "ipblacklist";}local function close_re...原创 2019-12-03 09:55:02 · 1089 阅读 · 0 评论 -
lua redis 管道
local redis = require "resty.redis_iresty"local opts = { ip = "192.168.31.247", port = "6379", password = "123456", db_index = 1}local red = redis:new(opts)local red =redis:new(o...原创 2019-12-01 08:15:11 · 260 阅读 · 0 评论 -
redis lua 二次封装类库
local redis_c = require "resty.redis"local ok, new_tab = pcall(require, "table.new")if not ok or type(new_tab) ~= "function" then new_tab = function (narr, nrec) return {} endendlocal _M = n...原创 2019-12-01 08:10:13 · 396 阅读 · 0 评论 -
lua + redis 连接池设置
local function close_redis(red) if not red then return end local pool_max_idle_time =10000 local pool_size =100 local ok,err = red:set_keepalive(pool_max_idle_time,...原创 2019-12-01 07:37:20 · 2228 阅读 · 0 评论 -
opresty + lua +redis helloworld
--关闭连接local function close_redis(red) if not red then return end local ok,err =red:close() if not ok then ngx.say("close redis err :",err) endend-...原创 2019-12-01 07:02:32 · 174 阅读 · 0 评论 -
spring集成redis
最近查看springboot 发现思想特别先进,页比较符合java开发思想,现在把redis序列化记录以下 @Bean public RedisTemplate redisTemplate(RedisConnectionFactory factory) { // 创建一个模板类 RedisTemplate<String, Object...原创 2019-09-10 14:39:24 · 88 阅读 · 0 评论 -
redis 位图操作(一)基本操作
最近做登录签到功能,想使用redis位图功能,在网上查了很多资料,包括官方的介绍的都不是很详细,今天我主要介绍一下相关操作,不足之处还请指出:基本操作 :setbit key start end 不介绍getbit key index 不介绍bitcount key start end (重点)本人在测试bitcount时遇到了问题,区间查询查不到数据,很是懊恼...原创 2019-08-09 08:33:18 · 322 阅读 · 0 评论 -
redis的使用场景分析
1、缓存减少数据库io2、最新的操作,或最近的评论(List)3、排行榜类4、计数器原创 2019-07-31 10:45:45 · 92 阅读 · 0 评论 -
redis 管理工具
原创 2019-07-31 10:34:31 · 331 阅读 · 0 评论 -
lua 对象添加方法
原创 2019-07-31 09:54:36 · 950 阅读 · 0 评论 -
lua redis metatable 操作
local score1={yw=80,sx=90}local score2={yw=100,sx=100}local myadd={}function myadd.__add(f1,f2) local res ={} res.yw=f1.yw + f2.yw res.sx=f1.sx +f2.sx return res...原创 2019-07-30 17:53:09 · 204 阅读 · 0 评论 -
redis 安装
centos 第一次安装前需要执行以下命令 yum install gcc-c++ libstdc++-devel make时报如下错误: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory zmalloc.h:55:2: error: #error "Newer version of...原创 2019-04-25 12:00:31 · 75 阅读 · 0 评论 -
通过jedis客户端连接redis写入报"JedisConnectionException: java.net.SocketException:
通过jedis客户端连接redis写入报"JedisConnectionException: java.net.SocketException: Software caused connection abort: socket write error"异常一、异常描述通过客户端jedis连接redis服务器并发写入数据时报出“redis.clients.jedis.exceptions.J...转载 2019-04-27 09:20:51 · 1604 阅读 · 0 评论 -
redis lua 使用 及lua安装
1、安装lua类库环境 1.1、yum install -y readline 1.2、yum install -y readline-devel2、下载lua最新的版本安装2.1、去官网下载lua,可以直接通过wget下载,地址如下:htt...原创 2019-04-26 10:04:47 · 806 阅读 · 0 评论