谨慎redis的timeout参数

最近一个同事问我,我的redis客户端不久就报错:

从提示的报错信息看是说:需要授权;于是就授权呗:

127.0.0.1:6379> auth test
OK
127.0.0.1:6379> ping
PONG

授权后一切正常,可问题是,授权后,很快又报同样的错误

127.0.0.1:6379> ping
(error) NOAUTH Authentication required.

这很是郁闷啊,我明明授权的了啊!我看了下,我想应该不是授权的问题,于是我看了下另外一个参数:timeout

127.0.0.1:6379> config get timeout

  1. “timeout”
  2. “60”

我想应该是这个问题,于是修改这个参数:

127.0.0.1:6379> config set timeout 0
OK

哈哈,这样一切正常了

当然最后别忘了:

127.0.0.1:6379> config rewrite
OK

否则,下次重启客户端,还是一样哦!

-----------------------------------------------------------------------------

后记:这个错误提示不能不说是redis的一个“坑”啊!这里记录,哈哈

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
About This Book Learn how to use Redis's data types efficiently to manage large data sets Scale Redis to multiple servers with Twemproxy, Redis Sentinel, and Redis Cluster A fast-paced guide, full of real-world examples to help you get the best out of the features offered by Redis Who This Book Is For If you are a competent developer with experience of working with data structure servers and want to boost your project's performance by learning about features of Redis, then this book is for you. What You Will Learn Build analytics applications using Bitmaps and Hyperloglogs Enhance scalability with Twemproxy, Redis Sentinel, and Redis Cluster Build a Time Series implementation in Node.js and Redis Create your own Redis commands by extending Redis with Lua Get to know security techniques to protect your data (SSL encryption, firewall rules, basic authorization) Persist data to disk and learn the trade-offs of AOF and RDB Understand how to use Node.js, PHP, Python, and Ruby clients for Redis Avoid common pitfalls when designing your next solution In Detail Redis is the most popular in-memory key-value data store. It's very lightweight and its data types give it an edge over the other competitors. If you need an in-memory database or a high-performance cache system that is simple to use and highly scalable, Redis is what you need. Redis Essentials is a fast-paced guide that teaches the fundamentals on data types, explains how to manage data through commands, and shares experiences from big players in the industry. We start off by explaining the basics of Redis followed by the various data types such as Strings, hashes, lists, and more. Next, Common pitfalls for various scenarios are described, followed by solutions to ensure you do not fall into common traps. After this, major differences between client implementations in PHP, Python, and Ruby are presented. Next, you will learn how to extend Redis with Lua, get to know security techniques such as basic authorization, firewall rules, and SSL encryption, and discover how to use Twemproxy, Redis Sentinel, and Redis Cluster to scale infrastructures horizontally. At the end of this book, you will be able to utilize all the essential features of Redis to optimize your project's performance. Style and approach A practical guide that offers the foundation upon which you can begin to understand the capabilities of Redis using a step-by-step approach. This book is full of real-world problems and in-depth knowledge of the concepts and features of Redis, with plenty of examples.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值