k8s-linux下Redis操作
参考链接:https://www.yisu.com/ask/6214.html
redis 中如何切换db:https://www.qyyshop.com/info/916129.html
root@master:~# kubectl exec -it redis-server-7fcdd746c9-s5j7h -n XXX bash //进入k8s的redis容器
root@redis-server-7fcdd746c9-s5j7h:/data# redis-cli -h 127.0.0.1 //链接接入redis服务
127.0.0.1:6379> DEL ipes:monitor:realdata_biz:JSYQ1032011600071000 //默认链接进去的是db 0,所以没有找到对应的key
(integer) 0
127.0.0.1:6379> KEYS 'ipes:monitor:realdata:*'
(empty list or set)
127.0.0.1:6379> KEYS 'ipes:monitor:realdata_biz:*'
(empty list or set)
127.0.0.1:6379> KEYS 'ipes*'
1) "ipes-prj-server:audit-record-new-time"
127.0.0.1:6379> select 4 //切换db索引
OK
127.0.0.1:6379[4]> set a db4 //切换db4名称
OK
127.0.0.1:6379[4]> DEL ipes:monitor:realdata_biz:JSYQ1032011600071000 //可以删除对应的key了
(integer) 1
##删除 hash值
hDel ipes:monitor:origindata JSYQ1032011600071001hDel ipes:monitor:origindata JSYQ1032011600071000