当前位置:网站首页>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边栏推荐
- Let‘sPlayCurling
- [protection mode] segment descriptor
- How does payment splitting help B2B bulk commodity transactions?
- [naturallanguageprocessing] [multimodality] ofa: unified architecture, tasks and modes through a simple sequence to sequence learning framework
- Add a second network card (network interface NIC) for the virtual machine in azure portal in 2 minutes
- DDoS "fire drill" service urges companies to prepare
- 假离婚变成真离婚,财产怎么办
- Illustration Google V8 19: asynchronous programming (II): how does V8 implement async/await?
- 006_ radio
- 012_ switch
猜你喜欢

007_ checkbox
![[MySQL 04] sauvegarde et restauration de la base de données MySQL sous Linux en utilisant MySQL Workbench 8.0 ce](/img/e7/fc2925a10ac5fb370dd221c3f4a46a.png)
[MySQL 04] sauvegarde et restauration de la base de données MySQL sous Linux en utilisant MySQL Workbench 8.0 ce

Understand AQS principle (flow chart and synchronous queue diagram)

What problems can cloud storage architecture solve for Devops?

什么是幂等性?四种接口幂等性方案详解!

Implementation of a simple camera based on pyqt5

Jenkins continuous integration environment construction VII (Jenkins parametric construction)

How does payment splitting help B2B bulk commodity transactions?
![[protection mode] segment descriptor](/img/23/19b12c496da437fbf03829b7b4e3b8.jpg)
[protection mode] segment descriptor

【MySQL 04】使用MySQL Workbench 8.0 CE 備份及恢複Linux中的MySQL數據庫
随机推荐
NCA: the nine year old has launched a DDoS attack
Learning C language from scratch day 026
Realization of a springboard machine
Que se passe - t - il si un faux divorce devient un vrai divorce?
26.算法常用面试题
【MySQL 04】使用MySQL Workbench 8.0 CE 備份及恢複Linux中的MySQL數據庫
33Mysql
DDoS extortion attacks: what you need to know
012_ switch
If mybaits cannot query the data, it can query how to change it in the database
搞透AQS原理(流程圖及同步隊列圖解)
Weekly recommended short video: why is the theory correct but can not get the expected results?
Day_ 19 multithreading Basics
004_ icon
Blue Bridge Cup stm32g431 - three lines of code for keys (long press, short press, click, double click)
dhu编程练习
If mybaits cannot query the data, it can query how to change it in the database
Using grpcui to test asp Net core grpc service
DDoS "fire drill" service urges companies to prepare
DDoS threat situation gets worse