1、修改配置文件参数,“persistence-available no” 主从复制失败。
原因是该方式关闭了用于主从同步功能的快照方式。在配置文件文件有这样一段话:“这个配置一般不会和RDB或者AOF的持久化相关的配置一起使用”,因此这个配置使用在单节点作为LRU缓存服务时使用。
[4744] 11 Jul 13:15:47.234 * Connecting to MASTER 127.0.0.1:6379
[4744] 11 Jul 13:15:47.874 * MASTER <-> SLAVE sync started
[4744] 11 Jul 13:15:47.889 * Non blocking connect for SYNC fired the event.
[4744] 11 Jul 13:15:47.889 * Master replied to PING, replication can continue...
[4744] 11 Jul 13:15:47.889 * (Non critical) Master does not understand REPLCONF listening-port: -ERR unknown command 'REPLCONF'
[4744] 11 Jul 13:15:47.889 * (Non critical) Master does not understand REPLCONF capa: -ERR unknown command 'REPLCONF'
[4744] 11 Jul 13:15:47.889 * Partial resynchronization not possible (no cached master)
[4744] 11 Jul 13:15:47.889 * Master does not support PSYNC or is in error state (reply: -ERR unknown command 'PSYNC')
[4744] 11 Jul 13:15:47.889 * Retrying with SYNC...
[4744] 11 Jul 13:15:47.889 # MASTER aborted replication with an error: ERR unknown command 'SYNC'
2、持久化命令,BGSAVE、BGREWRITEAOF分别是在后台保存RDB和AOF文件用于手动触发生成持久化文件。
3、redis常用做为后台守护进程时,设置“daemonize yes”,设置后会生成类似/var/run/redis.pid文件,可进行查看。
来源:oschina
链接:https://my.oschina.net/u/914290/blog/710467