当前位置:网站首页>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边栏推荐
- Implement vs to run only one source file at a time
- 想转行,但不知道自己要做什么工作比较好?
- If mybaits cannot query the data, it can query how to change it in the database
- scp远程拷贝命令记录
- 什么是幂等性?四种接口幂等性方案详解!
- UE5的蓝图节点拷贝到UE4后连线和属性值全部丢失了
- Geotools wkt coordinate system conversion
- 33Mysql
- Widget uses setimageviewbitmap method to set bug analysis
- Using grpcui to test asp Net core grpc service
猜你喜欢
![[protection mode] segment descriptor](/img/23/19b12c496da437fbf03829b7b4e3b8.jpg)
[protection mode] segment descriptor

33Mysql

Openlayers 3 built in interaction

ROS Bridge 笔记(01)— apt 安装、源码编译安装、安装依赖、运行显示

一种跳板机的实现思路

【MySQL 04】使用MySQL Workbench 8.0 CE 备份及恢复Linux中的MySQL数据库

What is idempotency? Detailed explanation of four interface idempotence schemes!

Recheck on February 15, 2022

006_ radio

Widget uses setimageviewbitmap method to set bug analysis
随机推荐
Simple implementation of unity object pool
【MySQL 06】linux + Docker容器环境中备份和还原MySQL数据库
Est - ce que la bourse en ligne est sécurisée? Dois - je ouvrir un compte pour la spéculation boursière?
实现VS每次只运行一个源文件
006_ radio
widget使用setImageViewBitmap方法设置bug分析
每周推荐短视频:为什么理论正确但得不到预期结果?
Is it safe to open an account in Sinosteel futures?
DDoS attacks - are we really at war?
What is idempotency? Detailed explanation of four interface idempotence schemes!
UE5的蓝图节点拷贝到UE4后连线和属性值全部丢失了
DDoS "fire drill" service urges companies to prepare
DDoS extortion attacks: what you need to know
假离婚变成真离婚,财产怎么办
[MySQL 05] SUSE 12 SP5 modifies the MySQL password for the first time after installing MySQL
scp远程拷贝命令记录
Encapsulate a complete version of the uniapp image and video upload component, which can be used immediately, switch between images and videos, customize the upload button style, delete the button sty
Upload, use of Avatar
dhu编程练习
云存储架构能解决 DevOps 的什么问题?