i have a large number of rdb files, and i want to inspect
them. what is the best way to do this -- without loading
them into redis?
is there any stand-alone tool to read and parse rdb files?
(the rdb files are not dumps, but redis diskstore files,
and each contains just a single redis hash. i would like
to extract some values from this hash.)
any hints appreciated ...
thanks
tim
you can easily create a Ruby/Python/Whatever script to parse large
quantities of RDB files, in theory.
In practice the file format is currently only documented in the source
code of Redis itself...
If you are going to do it, you can use this thread to ask whatever
question you need to get answered and I'll make my best efforts to
promptly reply, so that the thread can later turned into documentation
(or used to integrate documentation) of the RDB format.
I look forward to properly document the RDB format, but unfortunately
right now I can't because there are other priorities regarding the 2.6
release.
Thanks,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele
Hot loading is already possible with DEBUG RELOAD, but this will flush
the old dataset, and even if it works is not supported officially...
Another trick is to implement a fake slave, that will just send the
RDB file after the SYNC request... and finally will close the
connection: it is a trick but this is somewhat officially supported,
because it is at the base of replication.
However collision strategies are currently not an option, it's just
remove the old, add the new. The place where this could be done maybe
is in our famous redis-cli feature to handel the RDB format, so other
than dumping the RDB into CSV/JSON this wonder-redis-cli would also be
able to merge different RDB files with different strategies, or even
compute the intersection or difference between RDB files.
Cheers,
Salvatore
hmmm ..... i was kinda hoping somebody had done that already ;)
is redis-check-dump.c a good place to start?
Actually the node.js module to parse RDB, or the Redis source code
itself (rdb.c), is a better place since redis-check-dump is designed
to check for inconsistencies but does not directly handle many things
needed to really obtain all the infos from an RDB file.
Salvatore
> there is nodejs module for this: https://github.com/pconstr/rdb-parser
Cool, not bad at all, I read the source code a few minutes and it
seems pretty good with support for everything in 2.4.
Thanks for the info,
Salvatore
tim
https://gist.github.com/1670711
it only deals with my current problem (= redis diskstore files
which contain a single hash value), and does not handle
anything else yet, but it could of course be generalized ...
cheers
tim
On 2012-01-16, at 16:23 , Salvatore Sanfilippo wrote:
i implement a parser in perlhttps://github.com/flygoast/Redis-RdbParser
CPAN address
http://search.cpan.org/~flygoast/Redis-RdbParser-0.03/
cheers
flygoast