redis aof文件解析成命令
来源:互联网 发布:淘宝店铺修改发货地址 编辑:程序博客网 时间:2024/06/17 20:57
waoffle
A Redis AOF file parser. This module parses an AOF structure like this:
AOF文件解析器。这个模块解析一个AOF结构是这样的:
*3$9PEXPIREAT$10myRedisKey$131719298712484*3$3SET$9myJSONKey$24{"someKey": "someValue"}
... into raw Redis commands, like this:
生成命令行如下:
PEXPIREAT myRedisKey 1719298712484SET myJSONKey {"someKey": "someValue"}
The opposite can also be achieved by using the reverse binary (rwaoffle
) also provided in this module.
相反的也可以通过使用逆向二进制(rwaoffle)也提供了在这个模块。
Installation/Usage
You can install this module via npm
:
$ npm install -g waoffle
This installs a global binary waoffle
to which you can use to pipe your syrup data to:
$ cat appendonly.aof | waoffle # Pipe from other UNIX commands$ waoffle < appendonly.aof # or, pipe directly from stdin$ waoffle appendonly.aof # or, just specify the filename
Each of the three cases above are equivalent. The generated output will be streamed to stdout, to which you can dump into a file using redirection:
上面三种情况下是等价的。生成的输出流发送到stdout,你可以转储到一个文件中使用重定向:
$ waoffle < appendonly.aof > generated_commands.txt
The reverse process—going from sets of operations to AOF format—can be achieved in the same manner by substituting calls towaoffle
for rwaoffle
.
Importing data into Redis
This is useful for importing data directly into a running Redis instance. Simply use the rwaoffle
command if you are starting with a file full of operations. Even though Redis can already read its own AOF file format, this set of tools is even more powerful for filtering your AOF files:
这是用于将数据直接导入到运行的复述实例。仅仅使用rwaoffle命令,如果你从一个文件的操作。虽然复述,已经可以读自己的AOF文件格式,这组工具是更强大的过滤AOF文件:
$ waoffle < appendonly.aof | grep SET | rwaoffle # Only grab `SET` operations
Use this in combination with redis-cli --pipe
for maximum win:
$ cat appendonly.aof | redis-cli --pipe # Standard Redis import$ cat commands.txt | rwaoffle | redis-cli --pipe # Importing a list of commands$ cat appendonly.aof | waoffle | grep SET \ | rwaoffle | redis-cli --pipe # Import only `SET` operations
参考:https://github.com/nvite/waoffle
- redis aof文件解析成命令
- redis AOF文件过大
- redis的AOF文件格式的解析以及AOF文件的离线优化
- 转换成命令行SVN
- redis只加载AOF文件
- Redis源码解析:12AOF持久化
- redis的aof持久化深入解析
- redis的RDB和AOF原理解析
- Linux图形界面切换成命令行登录
- WPF中将事件包装成命令
- Redis之AOF文件持久化
- 解决redis下没有appendonly.aof文件
- redis aof
- redis aof
- redis-AOF
- redis-aof
- Redis源码解析(十五)--- aof-append only file解析
- 【Redis】redis的AOF
- How to Estimate Export File Size Without Creating Dump File
- 1 单例模式
- java面试题(六)
- android studio 2.2 NDK开发经验总结及相关错误汇总(旧版NDK开发转新版NDK开发经验)
- elasticserch +kibana+marvel+sense
- redis aof文件解析成命令
- sublime text 3
- C++17引入的模块为什么能加快编译速度?
- 使用c#发送邮件
- Just another Hello World
- 生活中的Paxos
- java面试题(七)
- AndroidStudio导入Unity步骤和遇到的一些问题
- ListView GridView图片错位处理