1.集群架构:解释:Redis 集群中内置了 16384 个哈希槽,当需要在 Redis 集群中放置一个 key-value 时, redis 先对 key 使用 crc16 算法算出一个结果,然后把结果对 16384 求余数, 这样每个 key 都会对应一个编号在 0-16383 之间的哈希槽,redis 会根据节点数量大致均等的将哈希槽映射到不同的节点 误区解释:这里的集群和主从复制不同,这里的集群中所有的都是mater,都有单节点顾长官问题,而主从复制只是解决单点故障问题,如果想让集群模式下午单点故障问题,需要给每一个master进行主从复制。2.redis-cluster 投票容错集群不可用状态的判断:3.redis集群的搭建 ①ruby的安装 由于集群管理工具(redis-trib.rb)是使用ruby脚本语言编写的,所以需要ruby的环境第一步:安装ruby [root@hdp01 bin2]# yum install ruby [root@hdp01 bin2]# yum install rubygems 第二步:将redis-3.0.0.gem文件上传到linux系统 第三步:安装ruby和redis接口 [root@hdp01 ~]# gem install redis-3.0.0.gem 第四步:将redis-3.0.0包下src目录中的以下文件拷贝到redis19/redis-cluster/ 第五步:查看是否拷贝成功 ②搭建集群:第二步:如果存在持久化文件,则删除 [root@hdp01 app]# rm -rf appendonly.aof dump.rdb 第三步:设置集群参数 开启集群模式: 第五步:复制redis服务到其他机器中>>> Creating cluster Connecting to node 192.168.242.137:7001: OK Connecting to node 192.168.242.137:7002: OK Connecting to node 192.168.242.137:7003: OK Connecting to node 192.168.242.137:7004: OK Connecting to node 192.168.242.137:7005: OK Connecting to node 192.168.242.137:7006: OK >>> Performing hash slots allocation on 6 nodes… Using 3 masters: 192.168.242.137:7001 192.168.242.137:7002 192.168.242.137:7003 Adding replica 192.168.242.137:7004 to 192.168.242.137:7001 Adding replica 192.168.242.137:7005 to 192.168.242.137:7002 Adding replica 192.168.242.137:7006 to 192.168.242.137:7003 M: 8240cd0fe6d6f842faa42b0174fe7c5ddcf7ae24 192.168.242.137:7001 slots:0-5460 (5461 slots) master M: 4f52a974f64343fd9f1ee0388490b3c0647a4db7 192.168.242.137:7002 slots:5461-10922 (5462 slots) master M: cb7c5def8f61df2016b38972396a8d1免费云主机域名f349208c2 192.168.242.137:7003 slots:10923-16383 (5461 slots) master S: 66adf006fed43b3b5e499ce2ff1949a756504a16 192.168.242.137:7004 replicates 8240cd0fe6d6f842faa42b0174fe7c5ddcf7ae24 S: cbb0c9bc4b27dd85511a7ef2d01bec90e692793b 192.168.242.137:7005 replicates 4f52a974f64343fd9f1ee0388490b3c0647a4db7 S: a908736eadd1cd06e86fdff8b2749a6f46b38c00 192.168.242.137:7006 replicates cb7c5def8f61df2016b38972396a8d1f349208c2 Can I set the above configuration? (type ‘yes’ to accept): yes >>> Nodes configuration updated >>> Assign a different config epoch to each node >>> Sending CLUSTER MEET messages to join the cluster Waiting for the cluster to join.. >>> Performing Cluster Check (using node 192.168.242.137:7001) M: 8240cd0fe6d6f842faa42b0174fe7c5ddcf7ae24 192.168.242.137:7001 slots:0-5460 (5461 slots) master M: 4f52a974f64343fd9f1ee0388490b3c0647a4db7 192.168.242.137:7002 slots:5461-10922 (5462 slots) master M: cb7c5def8f61df2016b38972396a8d1f349208c2 192.168.242.137:7003 slots:10923-16383 (5461 slots) master M: 66adf006fed43b3b5e499ce2ff1949a756504a16 192.168.242.137:7004 slots: (0 slots) master replicates 8240cd0fe6d6f842faa42b0174fe7c5ddcf7ae24 M: cbb0c9bc4b27dd85511a7ef2d01bec90e692793b 192.168.242.137:7005 slots: (0 slots) master replicates 4f52a974f64343fd9f1ee0388490b3c0647a4db7 M: a908736eadd1cd06e86fdff8b2749a6f46b38c00 192.168.242.137:7006 slots: (0 slots) master replicates cb7c5def8f61df2016b38972396a8d1f349208c2 [OK] All nodes agree about slots configuration. >>> Check for open slots… >>> Check slots coverage… [OK] All 16384 slots covered. ③测试集群是否搭建成功 [root@hdp01 7001]# ./redis-cli -h 192.168.130.130-p 6379 –c #连接集群 相关命令介绍:
本篇内容主要讲解“如何使用RMAN对CDB中的PDB进行复制”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何使用RMAN对CDB中的PDB进行复制”吧! 1.检查源RAC CDB(jy)的参数文件,数据文件,联机…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。