Home > Database > Mysql Tutorial > 轻松实现redis主从配置,链式,一主多从

轻松实现redis主从配置,链式,一主多从

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:58:56
Original
1152 people have browsed it

轻松实现redis主从配置,链式,一主多从 尼玛 是有多无聊,搞了个windows还去玩主从,鄙视之!!! 不多说了,小白玩Redis主动求喷。。。哈哈。。。 主的默认配置, 从:主的原本拷贝一份 1,改端口将默认的6379改为6380 # Accept connections on the specif

轻松实现redis主从配置,链式,一主多从

 

尼玛 是有多无聊,搞了个windows还去玩主从,鄙视之!!!

 

不多说了,小白玩Redis主动求喷。。。哈哈。。。

 

主的默认配置,

 

从:主的原本拷贝一份

 

1,改端口将默认的6379改为6380

 

# Accept connections on the specified port, default is 6379

port 6380

 

2,# slaveof

slaveof localhost 6379

 

轻松实现redis主从配置,链式,一主多从

 

上面这个还不过瘾,还是来Linux下试试吧

 

首先是配了3个实例slave1和slave2都是原封不动拷贝的master

 

轻松实现redis主从配置,链式,一主多从

 

配置是master: port 6379

 

slave1 

 

port 6380

 

slaveof localhost 6379

 

slave2

 

port 6381

 

slaveof localhost 6380

 

关系依次是:master

 

最终看看同步吧 ,最开始是master  :set master slave 发现另外两台从都可以get master 

 

但是当slave1 执行set slave master 是 master  上get slave 返回-1 而 slave2上返回master

 

轻松实现redis主从配置,链式,一主多从

 

还不过隐 再来个 一主多从吧

 

master两个从了分别是slave1 slave2

 

轻松实现redis主从配置,链式,一主多从

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template