redis單主機多實例

假設我們服務器上面已經安裝好了redis;

可參看:http://zlyang.blog.51cto.com/1196234/1834700

下面我們來配置redis單主機多實例:

我們首先拷貝兩份文件:

[root@infa redis-2.8.12]# cp /etc/redis.conf /etc/redis6380.conf

[root@infa redis-2.8.12]# cp /etc/redis.conf /etc/redis6381.conf

一、配置6380端口

 [root@infa ~]# vim /etc/redis6380.conf

191704029595236.png

[root@infa redis-2.8.12]# src/redis-server /etc/redis6380.conf

可以看到6380端口已經啓動起來

191704426931365.png

登錄6380端口:

191705164905040.png

二、同理我們配置6381端口:

191705556312581.png

[root@infa redis-2.8.12]# src/redis-server /etc/redis6381.conf

可以看到6381端口也已經啓動起來

登錄6381端口

191706328968896.png

查看進程:

191708053343756.png

二、配置主從:

修改從庫配置:

[root@infa redis-2.8.12]# vim /etc/redis6380.conf

[root@infa redis-2.8.12]# vim /etc/redis6381.conf

191727289436634.png

主庫

191728003965225.png

從庫:

191728320375759.png

可以看到主從數據實現同步;


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章