8000 无法执行redis-cli-new · Issue #2 · xiepaup/dbatools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

无法执行redis-cli-new #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dpheyu opened this issue Jun 6, 2018 · 11 comments
Open

无法执行redis-cli-new #2

dpheyu opened this issue Jun 6, 2018 · 11 comments

Comments

@dpheyu
Copy link
dpheyu commented Jun 6, 2018

提示无法执行二进制文件-bash: ./redis-cli-new: cannot execute binary file。请问是怎么回事

@xiepaup
Copy link
Owner
xiepaup commented Jul 7, 2018

下载个 redis-3.2.x 的源码 , 把 redis-cli-new.c 覆盖 redis-cli.c ; 执行make 编译重新生成一个二进制文件试试呢

@dpheyu
Copy link
Author
dpheyu commented Aug 30, 2018

通过你上面的回复,可以执行脚本了。但是跟理论的不太一样,比如我执行下面的脚本,理想的输出是最大的两个key,但结果却不只两个,而且不是按照从大到小的顺序排列的。请帮忙确定是否正常?只截图了部分信息,后面还有 summary 、Backtrace、Memory map等信息
[xx@centos-u7zz1y0e src]$ ./redis-cli -h x.x.x.x -p 6380 --bigkeys --bigkey-numb 2

Scanning the entire keyspace to find biggest keys as well as

average sizes per key type. You can use -i 0.1 to sleep 0.1 sec

per 100 SCAN commands (not usually needed).

[00.00%] Biggest string found so far 'Trend021662_20180830_20180829_JZZRJJHXL' with 517 bytes
[00.00%] Biggest string found so far 'Trend21662_20180801_20180830_JSH_KCCPS' with 531 bytes
[00.00%] Biggest string found so far 'targets_1404030403_20180830' with 737 bytes
[00.00%] Biggest string found so far 'VIS_multiIndex_targetsW0000021662_20180830' with 1143 bytes
[32.35%] Biggest string found so far 'CarService_CTDe0021662_20180830_shbu' with 2298 bytes
[32.35%] Biggest string found so far 'hBasic_dep000301270201_20180830_xiazu' with 45914 bytes

-------- summary -------

@xiepaup
Copy link
Owner
xiepaup commented Aug 30, 2018

[32.35%] Biggest string found so far 'CarService_CTDe0021662_20180830_shbu' with 2298 bytes
--这里可以理解为一个进度条,不是最终结果
可以看看最后的输出TOP N 这里

@dpheyu
Copy link
Author
dpheyu commented Aug 30, 2018

输出======= Memory map: ========后,最后就只输出Aborted结束了。是不是执行失败了呢?
image
没有TOP N的输出。。。

@xiepaup
Copy link
Owner
xiepaup commented Aug 30, 2018

额,挂了么,,,把,挂的那一串东西贴我下呢,我查查

@dpheyu
Copy link
Author
dpheyu commented Aug 30, 2018

redis版本:3.2.9。执行后输出信息见附件
info.txt

@xiepaup
Copy link
Owner
xiepaup commented Aug 30, 2018

感谢,这里其实结果已经出来了,但是在最后free对象的时候出错了,
-------- summary ------- 这部分是 结果
我在这里加了一下判断:
/* Free sds strings containing max keys */
for (int j=0;j<bigkeys[i]->size;j++){
if(bigkeys[i]) sdsfree(bigkeys[i]->keyName[j]);
if(bigkeys[i]) zfree(bigkeys[i]);
}

@xiepaup
Copy link
Owner
xiepaup commented Aug 30, 2018

这里麻烦重新拉一下代码编译一下, 我在我这边编译,奇怪的没能复现,但根据这个crash的地方确实是这里处理有问题,

@dpheyu
Copy link
Author
dpheyu commented Aug 31, 2018

通过你上面的建议,已经成功了,非常感谢。想问下,这种扫描消耗性能大吗?加入我的生产环境有上亿级的key,top5的话,会不会损害redis性能?有相关说明吗

@xiepaup
Copy link
Owner
xiepaup commented Aug 31, 2018

在不指定 -i 的情况下, 这个程序是会尽全力跑出结果的;会带来5k~7k的qps
建议再slave上跑,另外上亿的key跑的时间可能会比较长;

@dpheyu
Copy link
Author
dpheyu commented Apr 17, 2019

在redis-cluster的slave上,无法执行上述命令。直接提示Invalid reply type (6) for TYPE on key 'spring:session:pamirs:sessions:expires:c32d695d-cbd2-4580-9e38-2aa77a158add'!
是不是对cluster模式的slave是不支持的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0