redis-master 192.168.129.135 redis-slave1 192.168.129.136
# Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. port 6380 slaveof 192.168.129.135 6379 # TCP listen() backlog.
master_link_status:up表示链接上,不然为down。redis
1.master上set操做时报错或slave启动报错服务器
5053:S 10 Mar 21:03:19.834 * Connecting to MASTER 192.168.129.135:6379 5053:S 10 Mar 21:03:19.835 * MASTER <-> SLAVE sync started 5053:S 10 Mar 21:03:19.835 * Non blocking connect for SYNC fired the event. 5053:S 10 Mar 21:03:19.835 # Error reply to PING from master: '-MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.'
解决方法:在master上执行config set stop-writes-on-bgsave-error no网络
2.redis启动时报错socket
5053:S 10 Mar 21:12:38.167 * Connecting to MASTER 192.168.129.135:6379 5053:S 10 Mar 21:12:38.167 * MASTER <-> SLAVE sync started 5053:S 10 Mar 21:12:38.167 * Non blocking connect for SYNC fired the event. 5053:S 10 Mar 21:12:38.168 * Master replied to PING, replication can continue... 5053:S 10 Mar 21:12:38.168 * Partial resynchronization not possible (no cached master) 5053:S 10 Mar 21:12:38.168 * Full resync from master: e606a708c45e5fe0ce87c0d11ec246186fa8d668:1158 5053:S 10 Mar 21:12:43.171 # Opening the temp file needed for MASTER <-> SLAVE synchronization: Permission denied
解决方法:缘由是启动的当前用户对如下配置中的路径无写权限测试
redis.conf中code
3.redis启动报错ip
5135:S 10 Mar 21:28:25.447 * Connecting to MASTER 192.168.129.135:6379 5135:S 10 Mar 21:28:25.448 * MASTER <-> SLAVE sync started 5135:S 10 Mar 21:28:25.448 * Non blocking connect for SYNC fired the event. 5135:S 10 Mar 21:28:25.448 * Master replied to PING, replication can continue... 5135:S 10 Mar 21:28:25.448 * Partial resynchronization not possible (no cached master) 5135:S 10 Mar 21:28:25.448 * Full resync from master: e606a708c45e5fe0ce87c0d11ec246186fa8d668:2460 5135:S 10 Mar 21:28:25.541 # I/O error reading bulk count from MASTER: Resource temporarily unavailable
解决办法:缘由是主从服务之间没法通信,可以使用telnet进行测试。ci