#1.wget #tar zxvf redis-2.8.19.tar.gz #cd redis-2.8.19/src/ #vi Makefile PREFIX?=/opt/etc/redis #make && make install #redis_6309.conf daemonize yes pidfile /var/run/redis_6309.pid port 6309 tcp-backlog 10240 timeout 600 tcp-keepalive 60 loglevel notice logfile stdout logfile /data/log/redis/redis_6309.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 /data/redis/redis_6309/ slave-serve-stale-data yes slave-read-only yes repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly no appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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 #/opt/etc/redis/bin/redis-server /opt/etc/redis/conf/redis_6309.conf #SLAVE 配置 daemonize yes pidfile /var/run/redis_6309.pid port 6309 tcp-backlog 10240 timeout 600 tcp-keepalive 60 loglevel notice logfile stdout logfile /data/log/redis/redis_6309.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 /data/redis/redis_6309/ slave-serve-stale-data yes slave-read-only yes repl-disable-tcp-nodelay no slaveof 10.0.20.14 6309 slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly no appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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 二,redis master 非持久化,备持久化 2.1 master #redis 6309 daemonize yes pidfile /var/run/redis.pid port 6309 tcp-backlog 10240 timeout 0 tcp-keepalive 0 loglevel notice logfile stdout logfile /var/log/redis/redis_6309.log databases 16 #save 900 1 #save 300 10 #save 60 10000 save "" stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /var/lib/redis_6309/ slave-serve-stale-data yes slave-read-only yes repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly yes appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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 #redis 6310 more redis_6310.conf daemonize yes pidfile /var/run/redis_6310.pid port 6310 tcp-backlog 10240 timeout 0 tcp-keepalive 0 loglevel notice logfile stdout logfile /var/log/redis/redis_6310.log databases 16 #save 900 1 #save 300 10 #save 60 10000 save "" stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /var/lib/redis_6310/ slave-serve-stale-data yes slave-read-only yes repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly yes appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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 2.2 salve #redis 6309 daemonize yes pidfile /var/run/redis.pid port 6309 tcp-backlog 10240 timeout 0 tcp-keepalive 0 loglevel notice logfile stdout logfile /data/redis/logs/redis_6309.log databases 16 save 900 1 save 300 10 save 60 10000 save "" stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /data/redis/6309/redis_6309/ slave-serve-stale-data yes slave-read-only yes slaveof 10.0.20.179 6309 repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly no appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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 #redis_6310 more redis_6310.conf daemonize yes pidfile /var/run/redis_6310.pid port 6310 tcp-backlog 10240 timeout 0 tcp-keepalive 0 loglevel notice logfile stdout logfile /data/redis/logs/redis_6310.log databases 16 save 900 1 save 300 10 save 60 10000 save "" stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /data/redis/6310/redis_6310/ slave-serve-stale-data yes slave-read-only yes slaveof 10.0.20.179 6310 repl-disable-tcp-nodelay no slave-priority 100 maxmemory 4gb maxmemory-policy allkeys-lru appendonly no appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 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
原文地址:http://rickyhui.blog.51cto.com/10570875/1680763