当前位置:网站首页>How to display all keys through redis cli- How to show ALL keys through redis-cli?
How to display all keys through redis cli- How to show ALL keys through redis-cli?
2022-06-30 02:14:00 【French red wine sweet】
problem :
I am using redis as an in-memory database backend for django cache. I use redis As django Cached in memory database backend .
In particular, I use django-redis configured as follows: Especially the one I use django-redis The configuration is as follows :
CACHES = { 'default': { 'BACKEND': 'redis_cache.cache.RedisCache', 'KEY_PREFIX': DOMAIN_NAME, 'LOCATION': 'unix:/tmp/redis_6379.sock:1', 'OPTIONS': { 'PICKLE_VERSION': -1, # default 'PARSER_CLASS': 'redis.connection.HiredisParser', 'CLIENT_CLASS': 'redis_cache.client.DefaultClient', }, },}My django cache seem to work correctly. my Django The cache seems to be working properly .
The weird thing is that I cannot see django cache keys using the redis-cli command line. Strangely enough , I can't use it redis-cli The command line sees django Cache key .
[edit] Please notice in the following that I tried both with[ edit ] Please note that I have tried the following
$ redis-cliand and
$ redis-cli -s /tmp/redis_6379.sock[endedit][ End edit ]
with no difference. There is no difference between .
In particular, using the KEYS * command: especially , Use KEYS * command :
$ redis-cliredis 127.0.0.1:6379> keys *(empty list or set)but however
redis 127.0.0.1:6379> set stefano testOKredis 127.0.0.1:6379> keys *1) "stefano"while from django shell: And from Django Shell :
In [1]: from django.core.cache import cacheIn [2]: cache.keys('*')Out[2]:[u'django.contrib.sessions.cachebblhwb3chd6ev2bd85bawuz7g6pgaij8', u'django.contrib.sessions.cachewpxiheosc8qv5w4v6k3ml8cslcahiwna']If I'm using MONITOR on the cli: If I were in cli Upper use MONITOR :
redis 127.0.0.1:6379> monitorOK1373372711.017761 [1 unix:/tmp/redis_6379.sock] "KEYS" "project_prefix:1:*"I can see a request, using the django cache prefix; I can see a request , Use django Cache prefix ;which should prove the redis-cli is connected to the same service. This should prove redis-cli Connect to the same service .But even searching for that prefix in the redis-cli returns an (empty list or set) But even in redis-cli Searching for this prefix also returns (empty list or set)
Why is that? Why? ?
What is the mechanisms that compartmentalize the different caches on the same redis instance? In the same redis What is the mechanism for dividing different caches on an instance ?
Solution :
Reference resources : https://stackoom.com/en/question/1Bd5I边栏推荐
- 搞透AQS原理(流程图及同步队列图解)
- Matlab 2012a 绘制带箭头的线段
- 【银河麒麟V10】【桌面】火狐浏览器设置主页不生效
- 33Mysql
- Restore a 35k-55k Tencent Android Senior Engineer Interview
- The odoo15 page jumps directly to the editing status
- 005_ button
- 7 — filter
- Internet Crime Complaint Center reports an increase in DDoS Attacks
- Widget uses setimageviewbitmap method to set bug analysis
猜你喜欢
![[MySQL 06] backup and restore MySQL database in Linux + docker container environment](/img/4e/8662d15ff84b2436d02948019540d3.png)
[MySQL 06] backup and restore MySQL database in Linux + docker container environment

Learning C language from scratch day 026

007_ checkbox
![[naturallanguageprocessing] [multimodality] ofa: unified architecture, tasks and modes through a simple sequence to sequence learning framework](/img/c9/7be54c428212d7226cbbbb4800fcdb.png)
[naturallanguageprocessing] [multimodality] ofa: unified architecture, tasks and modes through a simple sequence to sequence learning framework

005_ button

Weekly recommended short video: why is the theory correct but can not get the expected results?

Implementation of a simple camera based on pyqt5

Recheck on February 15, 2022

A keepalived high availability accident made me learn it again!

Day_ 19 multithreading Basics
随机推荐
Summary of DOM
Understand AQS principle (flow chart and synchronous queue diagram)
Openlayers 3 built in interaction
Configure cross domain requests
Thinking carefully and fearfully: a software can be transmitted online to monitor whether employees want to "run away"
一种跳板机的实现思路
(4) Blender source code analysis flash window display process
[MySQL 04] use MySQL workbench 8.0 CE to back up and restore MySQL databases in Linux
Tencent released the first Office Photo 23 years ago. It's so chronological
当大学毕业感到迷茫怎么办?
[MySQL 04] sauvegarde et restauration de la base de données MySQL sous Linux en utilisant MySQL Workbench 8.0 ce
封装一个完整版的uniapp图片和视频上传组件,拿来即用,可进行图片视频切换,可自定义上传按钮样式,删除按钮样式,可单独上传图片或者视频,可限制上传数量
dhu编程练习
dhu编程练习
001_ layout
207. curriculum - graph theory, depth traversal
Vs realize quick replacement function
If mybaits cannot query the data, it can query how to change it in the database
018_ rate
widget使用setImageViewBitmap方法设置bug分析