今天配置redis主從復制時出現master_link_status:down提示。
首先打開slave的redis.conf配置文件,確定slaveof 和masterauth 兩個選項配置是否正確。
然后再把后台進程的選項關閉:daemonize no(應該大多數同學為了方便把它設為yes了)
slave再啟動時出現如下提示:
[10144] 14 May 01:04:22 * Connecting to MASTER...
[10144] 14 May 01:04:22 * MASTER <-> SLAVE sync started
[10144] 14 May 01:04:22 * Non blocking connect for SYNC fired the event.
[10144] 14 May 01:04:22 # Unable to AUTH to MASTER: Writing to master: No route to host
說slave連接不上master,那就可能是防火牆的原因了。於是用下面命令分別把master和slave防火牆關掉之后重啟,搞定!
service iptables stop