<强>一、原理强>
<强> 强>
强>
#,wget http://download.redis.io/releases/redis-3.0.7.tar。广州
#,tar zxvf redis-3.0.7.tar.gz #,cd redis-3.0.7 #,make 前缀=/数据/服务器/redis 安装
#,mkdir -p /数据/服务器/复述等 #,cp redis.conf ,/数据/服务器/复述等
#,sed 小姐;' s/daemonize 没有/daemonize 是的/g’,/数据/服务器/复述,/etc/复述。参看
#,wget -c http://soft.vpser.net/lnmp/ext/init.d.redis -O /etc/摆在复述 #,chmod 755年,/etc/init。d/复述,
#,mkdir /数据/服务器/复述/日志 #,touch /数据/服务器/复述/日志/复述。日志
#,mkdir /数据/服务器/复述/运行 #,mkdir /数据/服务器/复述/db
#,grep -v “^ #”, redis.conf | grep -v “^ $”,,,,,,,,,,,,,,,,,,,,,, daemonize yes pidfile /数据/服务器/复述/运行/redis.pid #定义端口 port 1234 #绑定IP bind 10.10.10.2 timeout 300, loglevel 注意 #指定日志目录 logfile /数据/服务器/复述/日志/redis.log databases 16 #配置持久化(rdb模式) 节省;900,1 节省;300,10 节省;60,10000 stop-writes-on-bgsave-error 是的 rdbcompression 是的 rdbchecksum 是的 #定义数据文件和目录 dbfilename master.rdb dir /数据/服务器/复述/db slave-serve-stale-data 是的 slave-read-only 是的 slave-priority 100 appendonly 没有 appendfsync everysec no-appendfsync-on-rewrite 没有 auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64 mb 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 是的 client-output-buffer-limit normal 0, 0, 0 mb60 client-output-buffer-limit slave 256 mb 64 client-output-buffer-limit pubsub 32 mb 8 mb 60
#,grep -v “^ #”, redis.conf | grep -v “^ $”, daemonize yes pidfile /数据/服务器/复述/运行/redis.pid port 1234, bind 10.10.10.3 timeout 300, loglevel 注意 logfile /数据/服务器/复述/日志/redis.log databases 16 节省;900,1 节省;300,10 节省;60,10000 stop-writes-on-bgsave-error 是的 rdbcompression 是的 rdbchecksum 是的 dbfilename slave.rdb dir /数据/服务器/复述/db slaveof 10.10.10.2 1234年,,,,,,,,,#指定主的地址 slave-serve-stale-data 是的 slave-read-only 是的 slave-priority 100 appendonly 没有 appendfsync everysec no-appendfsync-on-rewrite 没有 auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64 mb 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 是的 client-output-buffer-limit normal 0, 0, 0 mb60 client-output-buffer-limit slave 256 mb 64 client-output-buffer-limit pubsub 32 mb 8 mb 60
#,/数据/服务器/复述,/bin/redis-server /数据/服务器/复述,/etc/redis.conf #,tail -fn100 /数据/服务器/复述/日志/redis.log ,//检查日志是否有报错复述,主从同步与读写分离