redis资料收集
NOSQL数据库笔谈http://sebug.net/paper/databases/nosql/Nosql.html
官方地址
http://code.google.com/p/redis/
Redis配置参数详解
daemonize:是否以后台daemon方式运行pidfile:pid文件位置port:监听的端口号timeout:请求超时时间loglevel:log信息级别logfile:log文件位置databases:开启数据库的数量save * *:保存快照的频率,第一个*表示多长时间,第三个*表示执行多少次写操作。在一定时间内执行一定数量的写操作时,自动保存快照。可设置多个条件。rdbcompression:是否使用压缩dbfilename:数据快照文件名(只是文件名,不包括目录)dir:数据快照的保存目录(这个是目录)appendonly:是否开启appendonlylog,开启的话每次写操作会记一条log,这会提高数据抗风险能力,但影响效率。appendfsync:appendonlylog如何同步到磁盘(三个选项,分别是每次写都强制调用fsync、每秒启用一次fsync、不调用fsync等待系统自己同步)
下面是一个略做修改后的配置文件内容
daemonize yespidfile /usr/local/redis/var/redis.pidport 6379timeout 300loglevel debuglogfile /usr/local/redis/var/redis.logdatabases 16save 900 1save 300 10save 60 10000rdbcompression yesdbfilename dump.rdbdir /usr/local/redis/var/appendonly noappendfsync alwaysglueoutputbuf yesshareobjects noshareobjectspoolsize 1024
redis主从配置(master-slave)
启动主从服务,先启动主redis,再启动从 redis,因为从redis要依赖主redis
假设主服务监控6379端口,则设置从服务监控6380端口,需要新建redis.slave.conf文件,并修改配置
# Accept connections on the specified port, default is 6379port 6380################################# REPLICATION ################################## Master-Slave replication. Use slaveof to make a Redis instance a copy of# another Redis server. Note that the configuration is local to the slave# so for example it is possible to configure the slave to save the DB with a# different interval, or to listen to another port, and so on.## slaveof localhost 6380
页:
[1]