一、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 clone https://github.com/antirez/redis.git
cd redis git checkout 3.0 git checkout 3.2
(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.2添加了两个配置:
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
# 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
# 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守护进程,这个参数是和具体的操作系统相关的。
# 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.2.0的cluster完全兼容Redis3.0,也就是说可以混合部署组成集群,在Redis Cluster上Redis3.2.0没有做什么新的技术,但是也有一些比较重要的事情:
注意:上述特性均在Redis3.0.7有体现,如果对于Redis3.2.0不太放心的话,可以使用Redis3.0.7。
原文:
Sentinel connection sharing
不太了解,看着像是添加新的sentinel节点后,可以共享其他sentinel节点的master,对于sentinel监控多个master比较有用,这样扩展sentinel节点时候比较方便配置,有关这个后面会继续试验。
相关推荐
5. **Redis集群**:Redis 3.0引入了官方集群方案,通过分片(Sharding)实现数据分散,提高可扩展性。 了解以上基础知识后,你可以根据实际需求,结合Redis提供的命令和功能,进行更深入的开发和应用。记得在生产...
这个"Redis-3.2.zip"压缩包很可能包含了Redis 3.2版本的源代码、编译构建文件、配置文档以及可能的示例脚本等资源。下面将详细介绍Redis 3.2版本中的关键知识点。 1. **基本概念**: - **键值存储**:Redis的核心...
10. **模块系统**:Redis 3.0开始支持模块系统,允许开发者扩展Redis的功能,比如添加新的数据类型或命令。 了解以上知识点后,用户可以更有效地利用Redis-x64-3.2.100.zip中的内容来搭建、配置和管理自己的Redis...
### renren-fast开发文档3.0_完整版.pdf 关键知识点总结 #### 一、项目简介 **1.1 项目描述** - **renren-fast**:该项目是一款基于Spring Boot框架构建的轻量级权限管理系统。它具备了用户管理、角色管理、菜单...
谷歌翻译redis3.2文档
6. **Cluster集群**:Redis 3.0 开始支持分布式集群(Cluster)模式,3.2 版本进一步优化了集群的稳定性和可用性,可以自动处理节点故障,提供数据冗余和水平扩展能力。 7. **持久化机制**:Redis 提供两种持久化...
### Redis 3.0 集群安装及配置详解 #### 一、概述 Redis(Remote Dictionary Server)是一款开源的键值存储系统,以其高性能、低延迟的特点在缓存领域有着广泛的应用。随着数据量的增长,单一Redis实例往往难以满足...
不过,从Redis 3.0开始,官方提供了`redis-cli --cluster create`命令,使得创建集群更加简便,不再依赖于Ruby。 在实际操作中,我们还需要注意网络配置,确保所有节点间能够互相通信,并且根据实际需求调整Redis的...
附件是开源快速开发平台renren-security项目的 3.2版本【完整版】的开发文档,解压后为PDF格式。 —————————————————————————————————— renren-security (人人权限系统)是一套...
为您提供yshop前后端分离商城系统下载,yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀...
6. **缓存机制**:支持多种缓存方式,如文件缓存、Memcached、Redis等,提高系统性能。 7. **自动验证与填充**:在模型中可以定义数据验证规则和自动填充规则,确保数据安全。 **querylist3.0 知识点** QueryList ...
UI等entfrm-boot可视化开发平台使用说明:1、配置环境(jdk1.8、maven3.x、mysql5.6及以上、redis3.2及以上)2、创建数据库3、初始化sql脚本:entfrm.sql4、导入项目到IntelliJ IDE中5、修改配置文件entfrm-boot/...
15.11.1 Mysql主从复制 315 15.11.2 Canal简介 316 15.11.3 Canal示例 318 第4部分案例 323 16 构建需求响应式亿级商品详情页 324 16.1 商品详情页是什么 324 16.2 商品详情页前端结构 325 16.3 我们的性能数据 327 ...
在可靠性方面,两者都提供了持久化机制,但Redis的持久化可能导致数据一致性问题,而MongoDB在3.2版本后引入了多文档事务,增强了在分布式环境中的数据一致性。 在集群技术上,MongoDB的Sharding和Replica Set已经...
【技术架构】: 后端开发语言java,采用最新springcloudalibaba版本开发,框架oauth2+springboot2.6(可升级到3.0)+doubble3.2,使用nacos, seata,sentinel,,数据库mysql/mongodb/redis/可追加oceanbase和tidb超...