SLAVEOF host port

简介:

Redis SLAVEOF 命令可以将当前服务器转变为指定服务器的从属服务器(slave server)。

如果当前服务器已经是某个主服务器(master server)的从属服务器,那么执行 SLAVEOF host port 将使当前服务器停止对旧主服务器的同步,丢弃旧数据集,转而开始对新主服务器进行同步。

另外,对一个从属服务器执行命令 SLAVEOF NO ONE 将使得这个从属服务器关闭复制功能,并从从属服务器转变回主服务器,原来同步所得的数据集不会被丢弃。

利用『 SLAVEOF NO ONE 不会丢弃同步所得数据集』这个特性,可以在主服务器失败的时候,将从属服务器用作新的主服务器,从而实现无间断运行。

##返回值

simple-string-reply





本文作者:陈群
本文来自云栖社区合作伙伴rediscn,了解相关信息可以关注redis.cn网站。
目录
打赏
0
0
0
0
26198
分享
相关文章
阿里云Could not connect to SITP host: smtp.163.com,port: 25;
阿里云Could not connect to SITP host: smtp.163.com,port: 25;
342 1
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
423 0
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
1231 0
The connection to the server ip:6443 was refused - did you specify the right host or port
The connection to the server ip:6443 was refused - did you specify the right host or port
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等