codis codis-ha主从切换后服务器标记为offline,主要基于数据安全考虑,此时需要人工操作恢复主从关系
在offline的节点执行添加到组群命令,执行后offline的主机会重新与同组的master主机建立关系.
-
[codis@192_168_171_137 sample]$ ../bin/codis-config -c config.ini -L ./log/cconfig.log server add 4 192.168.171.140:6381 slave
-
{
-
"msg": "OK",
-
"ret": 0
-
}
可以看到已经从192.168.171.139的6381的master上进行全数据同步操作.
-
[26035] 24 Dec 09:44:06.083 * SLAVE OF 192.168.171.139:6381 enabled (user request)
-
[26035] 24 Dec 09:44:07.003 * Connecting to MASTER 192.168.171.139:6381
-
[26035] 24 Dec 09:44:07.014 * MASTER <-> SLAVE sync started
-
[26035] 24 Dec 09:44:07.015 * Non blocking connect for SYNC fired the event.
-
[26035] 24 Dec 09:44:07.023 * Master replied to PING, replication can continue...
-
[26035] 24 Dec 09:44:07.023 * Partial resynchronization not possible (no cached master)
-
[26035] 24 Dec 09:44:07.024 * Full resync from master: 88b4c4e35e4c03c551d6c2671f10a69be16726c6:57103419328
-
[26035] 24 Dec 09:48:25.171 * MASTER <-> SLAVE sync: receiving 9221662514 bytes from master
阅读(3214) | 评论(0) | 转发(0) |