Redis 3.0 与 3.2 配置文件变化
一、Redis3.0 与 3.2 配置文件对比
1. clone redis
git clone https://github.com/antirez/redis.git
2. checkout分支
cd redis
git checkout 3.0
git checkout 3.2
3. 比较
(1) 比较3.0和3.2文件变化数
> git rev-list 3.0..3.2 --count
1708
(2) 比较3.0和3.2文件变化统计
> git diff 3.0..3.2 --shortstat
比较3.0和3.2文件变化数
二、Redis3.0与3.2默认配置文件变化
1.配置变化

Redis3.2添加了两个配置:
protected-mode yes
supervised no
Redis3.2修改了个配置:
有关list的优化,由配置一改为配置二,虽然还没详细了解,应该是list的底层数据结构做了一些新的变化或者优化。
配置一:
list-max-ziplist-entries 512
list-max-ziplist-value 64
配置二:
list-max-ziplist-size -2
list-compress-depth 0
配置三:
bind 127.0.0.1
bind 在 Redis3.2.0 中默认改为 127.0.0.1
2.新配置说明
(1).protected-mode(默认是yes)
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
# "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
说明
用一段代码就可以说明什么是protected-mode
if (protected-mode && !requirepass && !bind) {
Allow only 127.0.0.1,::1 or socket connections
Deny (with the long message ever!) others
}
其实设置成默认是为了保护对redis不了解的人,提供安全性,但是对于对于不需要bind和requirepass的使用者(例如内网),需要将protected-mode设置为no
(2).supervised (默认是no)
# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
# supervised no - no supervision interaction
# supervised upstart - signal upstart by putting Redis into SIGSTOP mode
# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
# supervised auto - detect upstart or systemd method based on
# UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
# They do not enable continuous liveness pings back to your supervisor.
说明
可以通过upstart和systemd管理Redis守护进程,这个参数是和具体的操作系统相关的。
(3).bind (Redis3.2.0中bind默认是127.0.0.1)
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1
说明
bind在Redis3.2.0之前默认是0.0.0.0或者说””,为了保证不太了解Redis安全性的人,在Redis3.2.0中bind默认是127.0.0.1,也就是只有本机回环地址可以访问。如果需要配置sentinel、cluster或者需要机器机器可以访问该Redis实例请修改为0.0.0.0或者指定的内网IP.
(4).list-max-ziplist-size(默认-2)
# Lists are also encoded in a special way to save a lot of space.
# The number of entries allowed per internal list node can be specified
# as a fixed maximum size or a maximum number of elements.
# For a fixed maximum size, use -5 through -1, meaning:
# -5: max size: 64 Kb <-- not recommended for normal workloads
# -4: max size: 32 Kb <-- not recommended
# -3: max size: 16 Kb <-- probably not recommended
# -2: max size: 8 Kb <-- good
# -1: max size: 4 Kb <-- good
# Positive numbers mean store up to _exactly_ that number of elements
# per list node.
# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
# but if your use case is unique, adjust the settings as necessary.
(5).list-compress-depth(默认是0)
# Lists may also be compressed.
# Compress depth is the number of quicklist ziplist nodes from *each* side of
# the list to *exclude* from compression. The head and tail of the list
# are always uncompressed for fast push/pop operations. Settings are:
# 0: disable all list compression
# 1: depth 1 means "don't start compressing until after 1 node into the list,
# going from either the head or tail"
# So: [head]->node->node->...->node->[tail]
# [head], [tail] will always be uncompressed; inner nodes will compress.
# 2: [head]->[next]->node->node->...->node->[prev]->[tail]
# 2 here means: don't compress head or head->next or tail->prev or tail,
# but compress all nodes between them.
# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
# etc.
说明
Redis3.2.0引入了新的quicklist的数据结构做了list的底层存储方案。废弃了原来的两个配置参数,list-max-ziplist-entries 和 list-max-ziplist-value
127.0.0.1:6388> config get list-max-ziplist-size
1) "list-max-ziplist-size"
2) "-2"
127.0.0.1:6388> config get list-compress-depth
1) "list-compress-depth"
2) "0"
127.0.0.1:6388> lpush user_list u1 u2 u5 u7 u99 u10 u3
(integer) 7
127.0.0.1:6388> object encoding user_list
"quicklist"
在Redis3.2.0中设置原来的参数已经不生效了,应该是无法使用了。
127.0.0.1:6388> config set list-max-ziplist-entries 512
(error) ERR Unsupported CONFIG parameter: list-max-ziplist-entries
127.0.0.1:6388> config set list-max-ziplist-value 64
(error) ERR Unsupported CONFIG parameter: list-max-ziplist-value
有关quicklist的详细使用还需要查询文档和源码来研究
三、 Redis3.0与3.2关于Cluster的一些变化 (来自3.2-release-notes)
原文:
写道
Redis Cluster changes:
All the Redis Cluster changes in 3.2 were backported to 3.0, so there is
technically nothing new for now in this release. The most important things
are:* Cluster rebalancing.
* A pipelined MIGRATE command which is 10x faster and makes resharding
and rebalancing faster.
* Improved replicas migration.
* As a side effect of quicklists encoding (see above items), moving big
lists between nodes is now a lot faster.
Redis3.2.0的cluster完全兼容Redis3.0,也就是说可以混合部署组成集群,在Redis Cluster上Redis3.2.0没有做什么新的技术,但是也有一些比较重要的事情:
Redis Cluster均衡(应该是指redis-trib.rb中实现类将slot进行负载均衡的功能)
提供了一个基于流水线的migrate命令,用于水平迁移数据,速度是原来的10倍多。
提升了从几点迁移的功能。
在quicklist这种新的数据结构的帮助下,在节点之间迁移大的big list快了很多.
注意:上述特性均在Redis3.0.7有体现,如果对于Redis3.2.0不太放心的话,可以使用Redis3.0.7。
四、 Redis3.0与3.2关于Sentinel的一些变化 (来自3.2-release-notes)
原文:
Redis Sentinel changes:
* [NEW] Sentinel connection sharing. Makes Sentinels able to scale to
monitor many masters. (Salvatore Sanfilippo)
* [NEW] New SENTINEL INFO-CACHE command. (Matt Stancliff)
* More things backported to Redis 3.0 in the past, so no longer news of 3.2.
Sentinel connection sharing
不太了解,看着像是添加新的sentinel节点后,可以共享其他sentinel节点的master,对于sentinel监控多个master比较有用,这样扩展sentinel节点时候比较方便配置,有关这个后面会继续试验。
提供info-cache命令
Redis 3.0 与 3.2 配置文件变化的更多相关文章
- redis 3.0 集群__配置文件详解(常用配置)
参考文档 http://www.cnblogs.com/huangjacky/p/3700473.html http://www.cnblogs.com/cxd4321/archive/2012/12 ...
- Linux下安装redis 3.0及C语言中客户端实现demo
1.获取安装文件 wget http://download.redis.io/redis-stable.tar.gz 2.解压文件 tar xzvf redis-stable.tar.gz 3.进入目 ...
- Redis 7.0 新功能新特性总览
说明:本文根据Redis 7 RC2 的release note 整理并翻译 近日,Redis 开源社区发布了7.0的两个预览版.在这两个预览版中,有很多Redis 7.0中新增加的特性,新增加的命令 ...
- Redis 3.0 Cluster集群配置
Redis 3.0 Cluster集群配置 安装环境依赖 安装gcc:yum install gcc 安装zlib:yum install zib 安装ruby:yum install ruby 安装 ...
- Redis 3.0正式版发布,正式支持Redis集群
Redis是一个开源.基于C语言.基于内存亦可持久化的高性能NoSQL数据库,同时,它还提供了多种语言的API.近日,Redis 3.0在经过6个RC版本后,其正式版终于发布了.Redis 3.0的最 ...
- Redis 3.0.0 集群部署
简述: 1.0.1:redis cluster的现状 目前redis支持的cluster特性 1):节点自动发现 2):slave->master 选举,集群容错 3):Hot reshardi ...
- Redis 3.0 集群搭建
Redis 3.0 集群搭建 开启两个虚拟机 分别在两个虚拟机上开启3个Redis实例 3主3从两个虚拟机里的实例互为主备 下面分别在两个虚拟机上安装,网络设置参照codis集群的前两个主机 分别关闭 ...
- Redis 3.0.2集群搭建以及相关问题汇总
Redis3 正式支持了 cluster,是为了解决构建redis集群时的诸多不便 (1)像操作单个redis一样操作key,不用操心key在哪个节点上(2)在线动态添加.删除redis节点,不用停止 ...
- Redis 3.0集群 Window搭建方案
Redis 3.0集群 Window搭建方案 1.集群安装前准备 安装Ruby环境,安装:rubyinstaller-2.3.0-x64.exe http://dl.bintray.com/onecl ...
随机推荐
- Java监听器
监听器 1.概念 监听器:主要是用来监听特定对象的创建,属性的变化的!,本质上却是一个实现特定接口的普通java类! 对象分为自己创建自己使用的,和别人创建自己用的,自己创建的不需要监听,值需要取监听 ...
- chrome快捷键
常用的为: Ctrl + ] 下一个面板 Ctrl + [ 上一个面板 Ctrl + Alt + [ 去上一个历史记录的面板Ctrl + Alt + ] 去下一个历史记录的面板 Ct ...
- C++ "+="等运算符使用bug
昨晚写了一个程序,使用了"+="运算符,结果总不是我想要的,查了一晚没找到,今早才发现: timeInterval = tpImP.staTime - imgPara[serial ...
- 5G系统架构
原文标题:迈向5G之路,颠覆性的5G系统架构? 本文部分图片,资料摘自<迈向5G C-RAN:需求.架构与挑战> 突如一夜春风来,随着Polar码与LDPC码作为5G编码候选方案,通信 ...
- C语言学习 第九次作业总结
本次作业练习的内容是二维数组.下面我先简单的说下二维数组的基本知识点: 二维数组其实这个中文概念颇有误导--会让人感觉这是一个两个维度的概念.所以很多的国外的C语言书籍上会称这种数组为多下标数组:即首 ...
- iOS 设置不同的字体颜色
//设置不同字体颜色 -(void)fuwenbenLabel:(UILabel *)labell FontNumber:(UIFont *)font AndRange:(NSRange)range ...
- Mysql 中文乱码(Navicat for MySQL)
在使用Navicat for MySQL查看插入数据库的数据时,发现中文显示为乱码.搞了好久,理清思路如下: 确定mysql本身编码设置为utf8(也可以为gbk gb2312等) 用Navicat ...
- javascript json字符串与对象相互转换
在实际项目中,经常遇到字符格式的问题,记下来以便日后方便查看.用到两个函数:JSON.stringify() 和 JSON.parse(). 使用ajax向后台请求数据,后台给前端返回数据,明明后端脚 ...
- Android基础测试题(二)
今天给大家带来的是Android基础测试题(二) 题目要求: 定义一个5位长度的整型数组并初始化,然后构建方法根据用户传入的数字判断是否存在数组中,如果存在,返回所在位置,如果不存在,返回-1 首先第 ...
- 关于repaint(重绘)和reflow( 回流)
repaint就是重绘,reflow就是回流.repaint主要是针对某一个DOM元素进行的重绘,reflow则是回流,针对整个页面的重排 严重性: 在性能优先的前提下,性能消耗 reflow大于re ...