欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

AzureRedis系列之AzureRedis生成隨機(jī)數(shù)據(jù)-創(chuàng)新互聯(lián)

接下來準(zhǔn)備給各位介紹下如何來實(shí)現(xiàn)Azure Redis數(shù)據(jù)的遷移,我們經(jīng)常會(huì)收到一些需求,就是客戶需要將線下或者其他云上的Redis遷移到微軟的Azure Redis,或者是從微軟的某個(gè)region的Azure redis遷移到其他region

創(chuàng)新互聯(lián)主營黃龍網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,app軟件開發(fā)公司,黃龍h5成都小程序開發(fā)搭建,黃龍網(wǎng)站營銷推廣歡迎黃龍等地區(qū)企業(yè)咨詢

對(duì)于這些需求,我們其實(shí)可以通過分析,來判斷我們應(yīng)該用什么樣的方法進(jìn)行遷移,對(duì)于Azure Redis premium版本來說,我們是可以支持將數(shù)據(jù)導(dǎo)出到blob里,然后再導(dǎo)入到Premium版本的redis中的,這種遷移方法相對(duì)來說比較簡(jiǎn)單粗暴,但是Premium版本并不是每個(gè)用戶都會(huì)用的,而且Azure Redis也沒辦法從Premium版本降到Standard版本,所以這種遷移方法本身就有一定的局限性,之后準(zhǔn)備介紹一個(gè)微軟提供的跨region遷移Redis的方法,但是在這之前,我們需要先準(zhǔn)備一些測(cè)試的數(shù)據(jù),測(cè)試數(shù)據(jù)要盡量能模擬生產(chǎn)環(huán)境的模式,而且數(shù)據(jù)量不能太小,所以給各位介紹一個(gè)生成redis隨機(jī)數(shù)據(jù)的工具

首先感謝這位大佬提供的工具h(yuǎn)ttps://github.com/SaminOz/redis-random-data-generator

這個(gè)程序本身是用node.js寫的,所以我們首先需要準(zhǔn)備好node.js的環(huán)境

1.先在linux服務(wù)器裝好node.js

sudo yum install node.js

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

2.安裝依賴包,文檔中有很明確介紹都需要哪些包,直接安裝就好

├─┬ lorem-ipsum@1.0.3
│ └─┬ optimist@0.3.7
│ └── wordwrap@0.0.3
├─┬ redis-stream@0.1.0
│ └─┬ event-stream@2.1.9
│ ├── from@0.1.3
│ ├── optimist@0.2.8
│ └── through@0.0.4
└── uuid@3.0.1

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

使用NPM安裝各種包

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)? ?

3.下載https://github.com/SaminOz/redis-random-data-generator里的文件,拷貝到服務(wù)器上,可以看到程序本身包含這些文件

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

4.編輯config.json,添加Azure redis地址還有key

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

5.運(yùn)行node generator.js string 999999,隨機(jī)插入999999條數(shù)據(jù)到Azure Redis

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

6.連接到Azure Redis,通過info可以看到數(shù)據(jù)量已經(jīng)有200多M

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

8.查詢數(shù)據(jù),可以看到生成的都是一些隨機(jī)數(shù)據(jù)

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

當(dāng)然,不只是string,這個(gè)程序還可以支持redis其他格式的數(shù)據(jù),用起來還是很方便的

以下是這個(gè)程序的一些基本用法

Basic Usage:

node generator.js <type> <qty> [<key_prefix>]

This will enter <qty> of <type> entries into the redis instance

running at the server and port address set in the config.json

file.

If <key_prefix> is set then this will be prepended to the key (uuid) separated by a ":" - thanks to Alfonso Montero for this contribution

node generator.js hash 100 session

1)...

100) "session:ffab3b35-09c3-4fd7-9af1-4d323534065e"

Types (others may be added in future versions i.e. geohash):

'string' uses SET to add a redis string value

'list' uses LPUSH to add a random number of values to a list

'set' uses SADD to add a random number of values to a set

'sorted' uses ZADD to add a random number of values and scores

to a sorted set.

'hash' uses HMSET to add a random number of values to a hash

node generator.js –help可以查看幫助

Azure Redis 系列之 Azure Redis 生成隨機(jī)數(shù)據(jù)

準(zhǔn)備好數(shù)據(jù)之后,就可以看如何遷移了!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

本文標(biāo)題:AzureRedis系列之AzureRedis生成隨機(jī)數(shù)據(jù)-創(chuàng)新互聯(lián)
新聞來源:http://chinadenli.net/article46/ppheg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站、面包屑導(dǎo)航、電子商務(wù)Google、商城網(wǎng)站移動(dòng)網(wǎng)站建設(shè)

廣告

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

微信小程序開發(fā)