一、修改配置文件参数,“persistence-available no” 主从复制失败。redis
缘由是该方式关闭了用于主从同步功能的快照方式。在配置文件文件有这样一段话:“这个配置通常不会和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'
二、持久化命令,BGSAVE、BGREWRITEAOF分别是在后台保存RDB和AOF文件用于手动触发生成持久化文件。bash
三、redis经常使用作为后台守护进程时,设置“daemonize yes”,设置后会生成相似/var/run/redis.pid文件,可进行查看。code