濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Linux redis-Sentinel配置詳解

Linux redis-Sentinel配置詳解

熱門(mén)標(biāo)簽:高德地圖標(biāo)注無(wú)營(yíng)業(yè)執(zhí)照 東莞人工智能電銷機(jī)器人供應(yīng)商 智能電話機(jī)器人線路 廣州電銷機(jī)器人系統(tǒng)圖 江蘇電銷外呼防封系統(tǒng)是什么 金融行業(yè)外呼線路 長(zhǎng)沙開(kāi)福怎么申請(qǐng)400電話 賀州市地圖標(biāo)注app 百度地圖標(biāo)注要不要錢(qián)

下載

下載地址:https://redis.io/download

在/usr/local/src目錄下執(zhí)行下載。

wget http://download.redis.io/releases/redis-3.2.8.tar.gz

安裝

解壓到/usr/local/src目錄,放源碼包。

tar xzf redis-3.2.8.tar.gz

創(chuàng)建目錄/usr/local/redis:

make dir /usr/local/redis

進(jìn)入源碼目錄:

cd /usr/local/src/redis-3.2.8

然后執(zhí)行下面make命令編譯安裝到目錄/usr/local/redis/ (放執(zhí)行文件)。

make PREFIX=/usr/local/redis install

軟連接

程序做軟連接到bin目錄,方便直接執(zhí)行。

ln -s /usr/local/redis/bin/redis-cli /usr/local/bin/redis-cli
ln -s /usr/local/redis/bin/redis-sentinel /usr/local/bin/redis-sentinel
ln -s /usr/local/redis/bin/redis-server /usr/local/bin/redis-server

配置文件

復(fù)制配置文件,在源碼包里有sentinel.conf和redis.conf文件,復(fù)制到/etc/redis/目錄下,如果有多個(gè)實(shí)例,建議改名,如本實(shí)例用的redis端口是7021,sentinel是17021:

mkdir /etc/redis
cp /usr/local/src/redis-3.2.8/redis.conf /etc/redis/redis_6379.conf 
cp /usr/local/src/redis-3.2.8/sentinel.conf /etc/redis/sentinel_26379.conf

redis_master_6379.conf配置

修改配置以下參數(shù):

port 6379
daemonize yes
#requirepass 123456
#masterauth 123456

其中,daemonize屬性改為yes(后臺(tái)運(yùn)行)。

redis_slave_6380.conf 配置

修改配置以下參數(shù):

port 6380
daemonize yes
#requirepass yingjun
slaveof 192.168.248.128 6379
masterauth 123456

其他slave配置同此配置。

sentinel_26379.conf 配置

port 23791
daemonize yes
logfile "/var/log/sentinel_63791.log"
#master-1
sentinel monitor master-1 192.168.248.128 6379 2
#sentinel auth-pass master-1 yingjun

sentinel_26380.conf 配置

port 23780
daemonize yes
logfile "/var/log/sentinel_63780.log"
#master-1
sentinel monitor master-1 192.168.248.128 6379 2
#sentinel auth-pass master-1 yingjun

啟動(dòng)

順序依次啟動(dòng)服務(wù)。

redis-server /etc/redis/redis_master_6379.conf
redis-server /etc/redis/redis_slave_6380.conf 
redis-sentinel /etc/redis/sentinel_26379.conf
redis-sentinel /etc/redis/sentinel_26380.conf

查看進(jìn)程是否都已經(jīng)啟動(dòng)

[root@iZj6cqZ redis]# ps -ef | grep redis
root  10910  1 0 08:11 ?  00:00:00 redis-server 127.0.0.1:6379
root  10918  1 0 08:11 ?  00:00:00 redis-server 127.0.0.1:6380
root  10939  1 0 08:15 ?  00:00:00 redis-sentinel *:26379 [sentinel]
root  10944  1 0 08:15 ?  00:00:00 redis-sentinel *:26380 [sentinel]
root  10948 10851 0 08:15 pts/1 00:00:00 grep --color=auto redis

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

標(biāo)簽:北京 洛陽(yáng) 永州 玉樹(shù) 廊坊 松原 張家界 滄州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux redis-Sentinel配置詳解》,本文關(guān)鍵詞  Linux,redis-Sentinel,配置,詳解,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux redis-Sentinel配置詳解》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Linux redis-Sentinel配置詳解的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    肇东市| 大城县| 湄潭县| 砚山县| 荔浦县| 集贤县| 望谟县| 成都市| 界首市| 赞皇县| 恩平市| 冀州市| 汝州市| 二手房| 临夏市| 平昌县| 额济纳旗| 平度市| 徐水县| 娄烦县| 阿鲁科尔沁旗| 塘沽区| 蒲城县| 卢湾区| 文安县| 昌吉市| 扶绥县| 潢川县| 乡宁县| 和顺县| 邻水| 龙岩市| 龙泉市| 营口市| 文山县| 桦川县| 宁化县| 莎车县| 长乐市| 连平县| 安乡县|