日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
centos7上配置redis哨兵

1 配置三個redis數(shù)據(jù)庫, 一主兩從

我們提供的服務有:網(wǎng)站設計制作、做網(wǎng)站、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、赤峰ssl等。為成百上千企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術(shù)的赤峰網(wǎng)站制作公司

redis-6380.conf #主
redis-6381conf #從
redis-6382.conf #從
寫下以下配置文件

vim redis-6380.conf

port 6380
daemonize yes
pidfile /data/6380/redis.pid
loglevel notice
logfile "/data/6380/redis.log"
dbfilename dump.rdb
dir /data/6380
protected-mode no
再創(chuàng)建兩個配置文件6381和6382

sed "s/6380/6381/g" redis-6380.conf > redis-6381.conf
sed "s/6380/6382/g" redis-6380.conf > redis-6382.conf
創(chuàng)建數(shù)據(jù)文件目錄

mkdir -p /data/{6380,6381,6382}
給兩個從服務器配置文件再添加一行配置

在6381和6382配置文件添加這一行配置,表示指定主服務器為6380
slaveof 127.0.0.1 6380

2 啟動三個redis數(shù)據(jù)庫, 確保主從復制正常運行

redis-server redis-6380.conf
redis-server redis-6381.conf
redis-server redis-6382.conf

3 配置三個哨兵

cd /opt/redis/
vim redis-sentinel-16380.conf
vim redis-sentinel-16381.conf
vim redis-sentinel-16382.conf
寫入以下配置文件

port 16381
dir "/data/16381"
logfile "16381.log"
sentinel myid 3cf63a8e47b2372667013f8cdee7a3a5130d41fc
sentinel deny-scripts-reconfig yes
sentinel monitor qishimaster 127.0.0.1 6381 2
sentinel down-after-milliseconds qishimaster 60000
daemonize yes
哨兵配置文件詳解(不在步驟里面):

Sentinel節(jié)點的端口
port 26379
dir /var/redis/data/
logfile "26379.log"

sentinel announce-ip 127.0.0.1 # 宣告哨兵IP, 此配置只有當使用非127.0.0.1的IP配置哨兵無法成功時加上,同時redis三個服務端也需要同步修改IP

當前Sentinel節(jié)點監(jiān)控 127.0.0.1:6379 這個主節(jié)點
2代表判斷主節(jié)點失敗至少需要2個Sentinel節(jié)點節(jié)點同意
mymaster是主節(jié)點的別名
sentinel monitor mymaster 127.0.0.1 6379 2

每個Sentinel節(jié)點都要定期PING命令來判斷Redis數(shù)據(jù)節(jié)點和其余Sentinel節(jié)點是否可達,如果超過30000毫秒30s且沒有回復,則判定不可達
sentinel down-after-milliseconds mymaster 30000

當Sentinel節(jié)點集合對主節(jié)點故障判定達成一致時,Sentinel領導者節(jié)點會做故障轉(zhuǎn)移操作,選出新的主節(jié)點,原來的從節(jié)點會向新的主節(jié)點發(fā)起復制操作,限制每次向新的主節(jié)點發(fā)起復制操作的從節(jié)點個數(shù)為1
sentinel parallel-syncs mymaster 1

故障轉(zhuǎn)移超時時間為180000毫秒
sentinel failover-timeout mymaster 180000

daemonize yes
創(chuàng)建存放哨兵文件的目錄

mkdir -p /data/{16380,16381,16382}
啟動三個哨兵

redis-sentinel redis-sentinel-16380.conf
redis-sentinel redis-sentinel-16381.conf
redis-sentinel redis-sentinel-16382.conf
查看哨兵是否成功通信

redis-cli -p 16380 info sentinel


網(wǎng)站題目:centos7上配置redis哨兵
路徑分享:http://www.dlmjj.cn/article/gheeii.html