redis.7000.conf ``` protected-mode no port 7000 tcp-backlog 4095 timeout 30 tcp-keepalive 30 daemonize yes supervised no pidfile "/root/app/redis/logs/redis_7000.pid" loglevel notice logfile "/root/app/redis/logs/redis_7000.log" databases 16 save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename "dump.rdb" dir "/root/app/redis/data/7000" slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy volatile-lru appendonly yes appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes lua-time-limit 5000 cluster-enabled yes cluster-config-file "nodes-7000.conf" cluster-node-timeout 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit slave 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 aof-rewrite-incremental-fsync yes #masterauth "1q2w3e4r" #requirepass "1q2w3e4r" ``` redis.7001.conf ``` protected-mode no port 7001 tcp-backlog 4095 timeout 30 tcp-keepalive 30 daemonize yes supervised no pidfile "/root/app/redis/logs/redis_7001.pid" loglevel notice logfile "/root/app/redis/logs/redis_7001.log" databases 16 save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename "dump.rdb" dir "/root/app/redis/data/7001" slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy volatile-lru appendonly yes appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes lua-time-limit 5000 cluster-enabled yes cluster-config-file "nodes-7001.conf" cluster-node-timeout 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit slave 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 aof-rewrite-incremental-fsync yes #masterauth "1q2w3e4r" #requirepass "1q2w3e4r"equirepass "1q2w3e4r" ``` **RDB持久化失败解决方法:**      很简单,按提示的操作(将vm.overcommit\_memory 设为1)即可:      有三种方式修改内核参数,但要有root权限: (1)编辑/etc/sysctl.conf,改**vm.overcommit\_memory=1**,然后**sysctl -p**使配置文件生效  (2)**sysctl vm.overcommit\_memory=1**  (3)**echo 1 > /proc/sys/vm/overcommit\_memory**