redis cluster判断key属于那个分片。

一、判断阿里云 redis cluster,的key属于那个分片。

阿里云特有的命令info key 可以查看key属于那个slot,那个分片
命令行查看:

xxxx:6379> info key  xxxx_compressed_xxx
slot:4941 node_index:9
xxxx:6379> cluster keyslot xxxx_compressed_xxx
(integer) 4941
xxxx:6379:6379> 

也可以在dms查看。
在这里插入图片描述
如果实例是安全协同模式,dms安全规则需要增加:
在这里插入图片描述

在这里插入图片描述

// 文档:https://help.aliyun.com/document_detail/131131.html

if
  @fac.cmd_type in ['INFO']
then
  @act.allow_execute
elseif @fac.is_read
then
  @act.reject_execute '该命令被 "允许执行Hash读命令(白名单集合)"安全规则 禁用,需要使用请联系管理员修改模板或走工单流程'
end

二、原生 redis cluster查看方法

cluster nodes 或者 cluster slots 都可以查看所有分片对应slot的范围。

cluster keyslot keyname 命令可以查看某个key 属于那个slot。
以上两种命令结合可以判断key属于那个分片

命令说明
cluster nodes
https://cloud.tencent.com/developer/section/1374002
cluster slots
https://cloud.tencent.com/developer/section/1374009
cluster keyslot
https://cloud.tencent.com/developer/section/1374000

相关推荐

  1. RedisCluster集群扩容

    2023-12-27 07:44:06       68 阅读
  2. WordPress如何判断当前页是否属于文章页或页面?

    2023-12-27 07:44:06       34 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-27 07:44:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-27 07:44:06       106 阅读
  3. 在Django里面运行非项目文件

    2023-12-27 07:44:06       87 阅读
  4. Python语言-面向对象

    2023-12-27 07:44:06       96 阅读

热门阅读

  1. SpringBoot3 整合Redis

    2023-12-27 07:44:06       49 阅读
  2. vue3中安装并使用CSS预处理器Sass的方法介绍

    2023-12-27 07:44:06       62 阅读
  3. Redis Stream消息队列之基本语法与使用方式

    2023-12-27 07:44:06       39 阅读
  4. [oracle数据库]dblink的使用

    2023-12-27 07:44:06       63 阅读
  5. 如何将自建的ElasticSearch注册成一个服务

    2023-12-27 07:44:06       59 阅读
  6. codeforces 1676F

    2023-12-27 07:44:06       65 阅读
  7. latexshop 使用bug:xxx has a comma at the end

    2023-12-27 07:44:06       56 阅读
  8. c++ qt QtWidgetsApplication 项目 使用外部ui

    2023-12-27 07:44:06       61 阅读
  9. GO基础进阶篇 (八)、runtime包

    2023-12-27 07:44:06       67 阅读
  10. k8s解决 搭建集群的时候notReady问题

    2023-12-27 07:44:06       62 阅读
  11. 【Go语言入门:Go程序的流程控制语句】

    2023-12-27 07:44:06       50 阅读
  12. client-go使用方法

    2023-12-27 07:44:06       61 阅读