您好,登錄后才能下訂單哦!
這篇文章主要介紹“Redis怎么升級(jí)到容器化Redis-Sentinel集群”,在日常操作中,相信很多人在Redis怎么升級(jí)到容器化Redis-Sentinel集群?jiǎn)栴}上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”Redis怎么升級(jí)到容器化Redis-Sentinel集群”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!
receiver
、
app
的Redis連接字符串,驗(yàn)證
可附加
,方便Redis-Sentinel接入該網(wǎng)絡(luò),
所有容器同網(wǎng)絡(luò);為方便部署可將哨兵容器分配固定IP。......
// 下面生成的overlay網(wǎng)絡(luò)名稱是:eqidstack_webnet
networks:
webnet:
driver: overlay
attachable: true // 將現(xiàn)有的overlay網(wǎng)絡(luò)配置為:可附加容器
.....
/data
, 本處我們需要將現(xiàn)有的主機(jī)Redis dump.rdb文件外掛進(jìn)Master容器。# 下面是master/slave docker-compose.yml文件
version: '3.7'
services:
master:
image: redis
container_name: redis-master
command: redis-server --requirepass zxcde@1 --masterauth zxcde@1
volumes:
- /home/redis-sentinel/redis/data:/data
ports:
- "6380:6379"
networks:
- webnet
slave1:
image: redis
container_name: redis-slave-1
ports:
- "6381:6379"
command: redis-server --slaveof redis-master 6379 --masterauth zxcde@1 --requirepass zxcde@1
networks:
- webnet
slave2:
image: redis
container_name: redis-slave-2
ports:
- "6382:6379"
command: redis-server --slaveof redis-master 6379 --masterauth zxcde@1 --requirepass zxcde@1
networks:
- webnet
networks:
webnet:
external: true
name: eqidstack_webnet // 使用現(xiàn)有的Dokcer Overlay網(wǎng)絡(luò)
10.0.7.41:26379,10.0.7.42:26379,10.0.7.43:26379
是sentinel容器端點(diǎn),
serviceName
為Sentinel配置的Maser/slave名稱。"redis": "10.0.7.41:26379,10.0.7.42:26379,10.0.7.43:26379,serviceName=mymaster1,password=zxcde@1,abortConnect=false,connectTimeout=10000,writeBuffer=40960"
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。