成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

redis數(shù)據(jù)備份和遷移工具redis-dump如何安裝使用-創(chuàng)新互聯(lián)

這篇文章主要介紹redis數(shù)據(jù)備份和遷移工具redis-dump如何安裝使用,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

成都創(chuàng)新互聯(lián)公司是一家專業(yè)提供水磨溝企業(yè)網(wǎng)站建設(shè),專注與成都做網(wǎng)站、成都網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、H5建站、小程序制作等業(yè)務(wù)。10年已為水磨溝眾多企業(yè)、政府機構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)的建站公司優(yōu)惠進行中。

一.安裝:

# git clone https://github.com/delano/redis-dump.git

Initialized 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 691

Receiving objects: 100% (691/691), 2.09 MiB | 53 KiB/s, done.

Resolving deltas: 100% (293/293), done.

#gem install redis

Fetching: redis-4.0.2.gem (100%)

Successfully installed redis-4.0.2

Parsing documentation for redis-4.0.2

Installing ri documentation for redis-4.0.2

Done installing documentation for redis after 3 seconds

1 gem installed

#gem install uri-redis

Fetching: uri-redis-0.4.2.gem (100%)

Successfully installed uri-redis-0.4.2

Parsing documentation for uri-redis-0.4.2

Installing ri documentation for uri-redis-0.4.2

Done installing documentation for uri-redis after 0 seconds

1 gem installed

#gem install yajl-ruby

Fetching: yajl-ruby-1.4.1.gem (100%)

Building native extensions.  This could take a while...

Successfully installed yajl-ruby-1.4.1

Parsing documentation for yajl-ruby-1.4.1

Installing ri documentation for yajl-ruby-1.4.1

Done installing documentation for yajl-ruby after 1 seconds

1 gem installed

#gem install drydock

Fetching: drydock-0.6.9.gem (100%)

Successfully installed drydock-0.6.9

Parsing documentation for drydock-0.6.9

Installing ri documentation for drydock-0.6.9

Done installing documentation for drydock after 1 seconds

1 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號庫里寫點數(shù)據(jù):

#redis-cli

127.0.0.1:6379[1]> select 10

OK

127.0.0.1:6379[10]> set China World

OK

127.0.0.1:6379[10]> set love chenfeng

OK

127.0.0.1:6379[10]> set fuck America

OK

只備份10號庫:

#./redis-dump -u 127.0.0.1 -d 10  > /root/shell/20180928/db_10.json

查看內(nèi)容:

[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數(shù)據(jù)備份和遷移工具redis-dump如何安裝使用”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道!

分享名稱:redis數(shù)據(jù)備份和遷移工具redis-dump如何安裝使用-創(chuàng)新互聯(lián)
文章源于:http://jinyejixie.com/article40/ccesho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google網(wǎng)站維護、建站公司、商城網(wǎng)站ChatGPT、域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化
隆回县| 伊宁县| 保康县| 龙井市| 开阳县| 肥东县| 赞皇县| 祥云县| 滁州市| 崇礼县| 安陆市| 玛多县| 日照市| 新营市| 桐庐县| 揭东县| 保定市| 闸北区| 开阳县| 宾川县| 布尔津县| 龙山县| 岗巴县| 宁河县| 呼伦贝尔市| 弥渡县| 柯坪县| 察隅县| 景洪市| 富源县| 蕲春县| 德安县| 垣曲县| 关岭| 工布江达县| 碌曲县| 百色市| 勃利县| 武川县| 全州县| 伊金霍洛旗|