CentOS/Linux Redis叢集安裝

來源:互聯網
上載者:User

標籤:linux   redis   叢集   

在此文章中,只介紹redis叢集的安裝步驟,若想知道詳細過程,請參閱以下幾篇文章:

Redis叢集_1.redis安裝

Redis叢集_2.redis主從配置

Redis叢集_3.redis 主從自動切換Sentinel

Redis叢集_4.redis 啟動指令碼


系統內容:CentOS 6.5 mini

軟體版本:redis-2.8.19

IP地址:
節點1:192.168.100.211
節點2:192.168.100.212
節點3:192.168.100.213


Redis安裝(三個節點)
1:安裝相關依賴包
# yum -y install gcc make


2:安裝redis(三個節點)
軟體上傳到/main目錄
# cd /main/
# tar zxvf redis-2.8.19.tar.gz
# mv redis-2.8.19/ redis/
# cd redis/
# make && make install


3:修改設定檔(三個節點)
# mkdir /main/redis/logs
# vi /main/redis/redis.conf
daemonize yes
logfile "/main/redis/logs/redis.log"


4:指定Slave(在Slave節點配置)
# vi /main/redis/redis.conf
slaveof 192.168.100.211 6379


5:啟動redis(三個節點)
# /main/redis/src/redis-server /main/redis/redis.conf


6:指定監聽Master(三個節點)
# vi /main/redis/sentinel.conf
port 26379
daemonize yes
sentinel monitor mymaster 192.168.100.211 6379 2
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 900000
logfile "/main/redis/logs/sentinel.log"


7:啟動sentinel(三個節點):
# /main/redis/src/redis-sentinel /main/redis/sentinel.conf


8:關閉防火牆(三個節點)
# service iptables stop
# chkconfig iptables off


9:設定開機啟動(三個節點)
# echo "/main/redis/src/redis-server /main/redis/redis.conf" >> /etc/rc.local
# echo "/main/redis/src/redis-sentinel /main/redis/sentinel.conf" >> /etc/rc.local


註:初次開機時,必須先啟動Master


到此redis安裝完畢


CentOS/Linux Redis叢集安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.