redis资料收集

[size=large][color=darkblue]NOSQL数据库笔谈[/color][/size]
[url]http://sebug.net/paper/databases/nosql/Nosql.html[/url]

[size=large][color=darkblue]官方地址[/color][/size]
[url]http://code.google.com/p/redis/[/url]

[size=large][color=darkblue]Redis配置参数详解[/color][/size]

daemonize:是否以后台daemon方式运行
pidfile:pid文件位置
port:监听的端口号
timeout:剔除超时的空闲连接 Close the connection after a client is idle for N seconds (0 to disable)
loglevel:log信息级别
logfile:log文件位置
databases:开启数据库的数量
save * *:保存快照的频率,第一个*表示多长时间,第三个*表示执行多少次写操作。在一定时间内执行一定数量的写操作时,自动保存快照。可设置多个条件。
rdbcompression:是否使用压缩
dbfilename:数据快照文件名(只是文件名,不包括目录)
dir:数据快照的保存目录(这个是目录)
appendonly:是否开启appendonlylog,开启的话每次写操作会记一条log,这会提高数据抗风险能力,但影响效率。
appendfsync:appendonlylog如何同步到磁盘(三个选项,分别是每次写都强制调用fsync、每秒启用一次fsync、不调用fsync等待系统自己同步)


下面是一个略做修改后的配置文件内容

daemonize yes
pidfile /usr/local/redis/var/redis.pid
port 6379
timeout 300
loglevel debug
logfile /usr/local/redis/var/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /usr/local/redis/var/
appendonly no
appendfsync always
glueoutputbuf yes
shareobjects no
shareobjectspoolsize 1024


[size=large][color=darkblue]redis主从配置(master-slave)[/color][/size]
启动主从服务,先启动主redis,再启动从 redis,因为从redis要依赖主redis
假设主服务监控6379端口,则设置从服务监控6380端口,需要新建redis.slave.conf文件,并修改配置

# Accept connections on the specified port, default is 6379
port 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值