Python知識(shí)分享網(wǎng) - 專業(yè)的Python學(xué)習(xí)網(wǎng)站 學(xué)Python,上Python222
Redis Cluster集群模式學(xué)習(xí) PDF 下載
發(fā)布于:2024-02-21 12:06:08
(假如點(diǎn)擊沒反應(yīng),多刷新兩次就OK!)

Redis Cluster集群模式學(xué)習(xí) PDF 下載  圖1

 

 

資料內(nèi)容:

 

為什么是16384?
在Redis 集群中槽分配的元數(shù)據(jù)會(huì)不間斷的在Redis集群中分發(fā),以保證所有節(jié)點(diǎn)都知道槽的分配情況
16384=16k ,在發(fā)送?跳包時(shí)?char進(jìn)?bitmap壓縮后是2k??(2×(8bit)×1024(1k)=16k)
通常我們不會(huì)部署超過10000個(gè)Redis主節(jié)點(diǎn),因此16384就夠?了
Redis Cluster 集群構(gòu)建流程
redis-cluster.conf

 

#是否開啟集群
cluster-enabled yes
#?成的node?件,記錄集群節(jié)點(diǎn)信息,默認(rèn)為nodes.conf
cluster-config-file nodes.conf
#節(jié)點(diǎn)連接超時(shí)時(shí)間
cluster-node-timeout 20000
#集群節(jié)點(diǎn)映射端?
cluster-announce-port 6379
#集群節(jié)點(diǎn)總線端?,節(jié)點(diǎn)之間互相通信,常規(guī)端?+1萬
cluster-announce-bus-port 16379
EOF
cd /usr/local/redis-stable
./src/redis-server redis-cluster.conf

 

 

集群構(gòu)建命令,在任何?個(gè)節(jié)點(diǎn)上創(chuàng)建集群

 

./src/redis-cli -a 123456 --cluster create
192.168.31.102:6379 192.168.31.103:6379 192.168.31.104:6379
192.168.31.110:6379 192.168.31.111:6379 192.168.31.112:6379
--cluster-replicas 1