go-redis
go-redis copied to clipboard
Cluster Client debug object 'xxx', ERR no such key
Test Code:
func TestRedisCluster_DebugObject(t *testing.T) {
client := redis.NewClusterClient(&redis.ClusterOptions{
Addrs: []string{"127.0.0.1:7003"}, //set redis cluster url
Password: "", //set password
})
rs1, err := client.Get("key:150").Result()
if err != nil {
t.Fatal(err.Error())
}
fmt.Println(rs1)
rs2, err := client.DebugObject("key:150").Result()
if err != nil {
t.Fatal(err.Error())
}
fmt.Println(rs2)
}
output:
=== RUN TestRedisCluster_DebugObject
val:150
--- FAIL: TestRedisCluster_DebugObject (0.00s)
bat_test.go:266: ERR no such key
FAIL
@daiguadaidai How many nodes do you have in your cluster and what ports do they attached to? 6 nodes? :7000-:7005 ports? Could you please provide a way how you create redis cluster with the key:150/val:150
value?
Perhaps because this command is not recommended for usesd by clients, so redis does not specify the position of key
This issue is marked stale. It will be closed in 30 days if it is not updated.