分享更有价值
被信任是一种快乐

redis数据备份和迁移工具redis-dump如何安装使用

文章页正文上

这篇文章主要介绍redis数据备份和迁移工具redis-dump如何安装使用,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!一.安装:# git clone https://github.com/delano/redis-dump.gitInitialized empty Git repository in /root/shell/20180928/redis-dump/.git/remote: Enumerating objects: 691, done.remote: Total 691 (delta 0), reused 0 (delta 0), pack-reused 691Receiving objects: 100% (691/691), 2.09 MiB | 53 KiB/s, done.Resolving deltas: 100% (293/293), done.#gem install redisFetching: redis-4.0.2.gem (100%)Successfully installed redis-4.0.2Parsing documentation for redis-4.0.2Installing ri documentation for redis-4.0.2Done installing documentation for redis after 3 seconds1 gem installed#gem install uri-redisFetching: uri-redis-0.4.2.gem (100%)Successfully installed uri-redis-0.4.2Parsing documentation for uri-redis-0.4.2Installing ri documentation for uri-redis-0.4.2Done installing documentation for uri-redis after 0 seconds1 gem installed#gem install yajl-rubyFetching: yajl-ruby-1.4.1.gem (100%)Building native extensions. This could take a while…Successfully installed yajl-ruby-1.4.1Parsing documentation for yajl-ruby-1.4.1Installing ri documentation for yajl-ruby-1.4.1Done installing documentation for yajl-ruby after 1 seconds1 gem installed#gem install drydockFetchi免费主机域名ng: drydock-0.6.9.gem (100%)Successfully installed drydock-0.6.9Parsing documentation for drydock-0.6.9Installing ri documentation for drydock-0.6.9Done installing documentation for drydock after 1 seconds1 gem installed#ruby -rubygems bin/redis-dump{“db”:0,”key”:”192.168.184.122:6379:CommandCount:1528291051″,”ttl”:-1,”type”:”zset”,”value”:[[“LLEN”,1.0],[“DEL”,3.0],[“BRPOP”,7.0],[“RPOP”,234.0],[“SELECT”,236.0],[“HGET”,360.0],[“LPUSH”,437.0],[“GET”,460.0]],”size”:68}{“db”:0,”key”:”192.168.184.226:6379:KeyCount:1528190344″,”ttl”:-1,”type”:”zset”,”value”:[[“1”,1.0],免费主机域名[“None”,2.0],[“zhsq_kb_comment_data”,9.0],[“zhsq_ecom_comment_buffer”,36.0],[“zhsq_topic_filter_buffer”,120.0],[“zhsq_filter_buffer”,132.0],[“zhsq_topic_data”,183.0],[“zhsq_mon_buffer”,191.0],[“zhsq_data”,214.0],[“zhsq_jfilter_data”,225.0]],”size”:190}{“db”:0,”key”:”192.168.184.122:6379:CommandCountByMinute”,”ttl”:-1,”type”:”hash”,”value”:{“180605:9:23″:”22393″,”180606:13:16″:”945″,”180606:13:17″:”3568″,”180606:13:20″:”11768″},”size”:64}{“db”:0,”key”:”192.168.184.220:6379:CommandCountByMinute”,”ttl”:-1,”type”:”hash”,”value”:{“180605:9:23″:”22998″,”180606:13:16″:”993″,”180606:13:17″:”3818″,”180606:13:20″:”12101″},”size”:64}{“db”:0,”key”:”192.168.184.213:6379:KeyCount:1528291078″,”ttl”:-1,”type”:”zset”,”value”:[[“*”,1845.0]],”size”:7}……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..{“db”:1,”key”:”hello”,”ttl”:-1,”type”:”string”,”value”:”world”,”size”:5}{“db”:5,”key”:”dsf”,”ttl”:-1,”type”:”string”,”value”:”chenfeng”,”size”:8}{“db”:5,”key”:”hello”,”ttl”:-1,”type”:”string”,”value”:”world”,”size”:5}{“db”:6,”key”:”love”,”ttl”:-1,”type”:”string”,”value”:”peihy”,”size”:5}{“db”:6,”key”:”dsf”,”ttl”:-1,”type”:”string”,”value”:”chenfeng”,”size”:8}{“db”:6,”key”:”hello”,”ttl”:-1,”type”:”string”,”value”:”world”,”size”:5}{“db”:7,”key”:”love”,”ttl”:-1,”type”:”string”,”value”:”peihy”,”size”:5}{“db”:7,”key”:”chenfeng”,”ttl”:-1,”type”:”string”,”value”:”dsf”,”size”:3}二.使用:全库备份例子:#cd redis-dump/bin#./redis-dump -u 127.0.0.1 > /root/shell/20180928/db_all.json只备份redis某个库的例子:首先往10号库里写点数据:#redis-cli127.0.0.1:6379[1]> select 10OK127.0.0.1:6379[10]> set China WorldOK127.0.0.1:6379[10]> set love chenfengOK127.0.0.1:6379[10]> set fuck AmericaOK只备份10号库:#./redis-dump -u 127.0.0.1 -d 10 > /root/shell/20180928/db_10.json查看内容:[root@alpha-mongo-140-52 ~/shell/20180928/redis-dump/bin]#cat /root/shell/20180928/db_10.json{“db”:10,”key”:”fuck”,”ttl”:-1,”type”:”string”,”value”:”America”,”size”:7}{“db”:10,”key”:”love”,”ttl”:-1,”type”:”string”,”value”:”chenfeng”,”size”:8}{“db”:10,”key”:”China”,”ttl”:-1,”type”:”string”,”value”:”World”,”size”:5}以上是“redis数据备份和迁移工具redis-dump如何安装使用”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注云技术行业资讯频道!

相关推荐: mysql中怎么用数字辅助表补录数据一则

这篇文章给大家分享的是有关mysql中怎么用数字辅助表补录数据一则的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。 结构:create table user_baseinfo( userid bigint not null prima…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册