codis icon indicating copy to clipboard operation
codis copied to clipboard

怎么查看codis上面任意一个slot上附着的数据?

Open ghost opened this issue 10 years ago • 5 comments

我知道某个slot的id或者某些id范围,但是 怎么查看codis上面任意一个slot上附着的数据?

ghost avatar Oct 12 '16 07:10 ghost

<= 3.0 版本不支持这个功能。

3.1 版本开始支持 SLOTSSCAN,前提是 codis-proxy 和 codis-server 都是 3.1 的才可以。

spinlock avatar Oct 12 '16 08:10 spinlock

@spinlock 那就是说我现在是3.0.3查看不了呗?那有什么其他办法可以查看吗

ghost avatar Oct 12 '16 08:10 ghost

这个功能需要 codis-server 支持,但是一开始就没有实现这个功能。所以比较难。

一种偷懒的方法是,拿一个 codis-server3.1 作为 slave 挂到 codis-server3.0。然后用 slots scan 扫 codis-server3.1 然后给 codis-server3.0 发指令,这样比较绕,但无论如何也是比较快的方法。

另外一种方法是修改 redis-port,然后挂到 codis-server3.0 上分析。

On Oct 12, 2016, at 16:56, Umbraller [email protected] wrote:

@spinlock https://github.com/spinlock 那就是说我现在是3.0.3查看不了呗?那有什么其他办法可以查看吗

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CodisLabs/codis/issues/983#issuecomment-253157119, or mute the thread https://github.com/notifications/unsubscribe-auth/AAsHpUq_oyZMkh0NslnHhvHfq_eLfCB4ks5qzKCzgaJpZM4KUeC_.

spinlock avatar Oct 12 '16 08:10 spinlock

@spinlock 第一种方法懂,但是第二种,你说的修改redis port,这个不太理解,麻烦您能说的具体些吗

ghost avatar Oct 12 '16 09:10 ghost

@Umbraller 我没猜错的话,意思是修改 redis-port,把 codis-server 里的数据 dump 出来,然后自己计算 key 对应的 slot,这样就拿到了 slot 对应的全部 key

Saerdna avatar Nov 02 '16 03:11 Saerdna