redis-cluster集群安装(基于redis-3.2.10)
上节主要演示了redis单节点的安装部署,对于数据量更大的服务可以安装redis-cluster进行处理
1. 安装ruby
yum install ruby ruby-devel rubygems rpm-build -y
rpm -qa|grep ruby
ruby -v
2.安装redis-cluster
gem install redis --version 3.2.
gem list
3.到redis源码目录找到集群创建工具
/bin/cp /server/tools/redis-3.2./src/redis-trib.rb /usr/local/redis/bin/
4.创建redis-cluster集群节点
(1)创建节点目录,修改配置文件
[root@redis-server tools]# mkdir -p /usr/local/redis/redis-cluster/{7001,7002,7003}
cluster-enabled yes
cluster-config-file /usr/local/redis/redis-cluster//nodes-.conf
cluster-node-timeout
appendonly yes
[root@redis-server tools]# sh -x add_redis-cluster-port_rc.sh
+ echo '------ Start Create redis-cluster ------'
------ Start Create redis-cluster ------
+ redisport1=
+ redisport2=
+ redisport3=
+ redis_path=/usr/local/redis
+ redis_cluster_path=/usr/local/redis/redis-cluster
++ grep -v 127.0.0.1
++ grep -v inet6
++ grep inet
++ awk '{print $2}'
++ /sbin/ifconfig -a
++ tr -d addr:
+ localIP=192.168.1.71
+ '[' -z ']'
+ echo 'The redis-port is 8001'
The redis-port is
+ '[' -z ']'
+ echo 'The redis-port is 8002'
The redis-port is
+ '[' -z ']'
+ echo 'The redis-port is 8003'
The redis-port is
+ echo /usr/local/redis/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
/usr/local/redis/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+ sleep
+ mkdir -p /usr/local/redis/redis-cluster/ /usr/local/redis/redis-cluster/ /usr/local/redis/redis-cluster/
+ cd /server/tools/
+ /bin/cp democonf_redis-cluster_6379.conf /usr/local/redis/redis-cluster//conf-.conf
+ sed -i s###g /usr/local/redis/redis-cluster//conf-.conf
+ /bin/cp democonf_redis-cluster_6379.conf /usr/local/redis/redis-cluster//conf-.conf
+ sed -i s###g /usr/local/redis/redis-cluster//conf-.conf
+ /bin/cp democonf_redis-cluster_6379.conf /usr/local/redis/redis-cluster//conf-.conf
+ sed -i s###g /usr/local/redis/redis-cluster//conf-.conf
+ tree /usr/local/redis/redis-cluster
/usr/local/redis/redis-cluster
├──
│ └── conf-.conf
├──
│ └── conf-.conf
└──
└── conf-.conf directories, files
+ echo '------ Start redis-cluster nodes ------'
------ Start redis-cluster nodes ------
+ sleep
+ /usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
+ /usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
+ /usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
++ date +%F
+ echo '# redis-cluster-port for 8001,8002,8003 in 2017-09-21'
+ echo '/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/8001/conf-8001.conf'
+ echo '/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/8002/conf-8002.conf'
+ echo '/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/8003/conf-8003.conf'
+ tail - /etc/rc.local
tail: 无法使用 inotify 机制,回归为 polling 机制
# redis-cluster-port for ,, in --
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster//conf-.conf
+ echo '------ Create redis-cluster ------'
------ Create redis-cluster ------
+ sleep
+ /usr/local/redis/bin/redis-trib.rb create --replicas 192.168.1.71: 192.168.1.71: 192.168.1.71:
>>> Creating cluster
Connecting to node 192.168.1.71:: OK
Connecting to node 192.168.1.71:: OK
Connecting to node 192.168.1.71:: OK
>>> Performing hash slots allocation on nodes...
Using masters:
192.168.1.71:
192.168.1.71:
192.168.1.71:
M: 97ca887459268c2effca0af3263dcd00e83cae37 192.168.1.71:
slots:- ( slots) master
M: e43cda13f069241a25786bb4916e21e7e8a5e1d5 192.168.1.71:
slots:- ( slots) master
M: 53383a751348ed8bd2ec88fd487ada344c7a7bc8 192.168.1.71:
slots:- ( slots) master
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.1.71:)
M: 97ca887459268c2effca0af3263dcd00e83cae37 192.168.1.71:
slots:- ( slots) master
M: e43cda13f069241a25786bb4916e21e7e8a5e1d5 192.168.1.71:
slots:- ( slots) master
M: 53383a751348ed8bd2ec88fd487ada344c7a7bc8 192.168.1.71:
slots:- ( slots) master
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All slots covered.
+ echo '------ Test redis-cluster ------'
------ Test redis-cluster ------
+ sleep
+ grep --color=auto redis-server
+ netstat -anptl
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 0.0.0.0: 0.0.0.0:* LISTEN /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
tcp 192.168.1.71: 192.168.1.71: ESTABLISHED /redis-server
+ /usr/local/redis/bin/redis-cli -c -p
127.0.0.1:> exit
+ echo '------ Create redis-cluster is OK! ------'
------ Create redis-cluster is OK! ------
[root@zstest1 tools]#
redis-cluster集群安装(基于redis-3.2.10)的更多相关文章
- redis cluster 集群 安装 配置 详解
redis cluster 集群 安装 配置 详解 张映 发表于 2015-05-01 分类目录: nosql 标签:cluster, redis, 安装, 配置, 集群 Redis 集群是一个提供在 ...
- Redis Cluster集群知识学习总结
Redis集群解决方案有两个: 1) Twemproxy: 这是Twitter推出的解决方案,简单的说就是上层加个代理负责分发,属于client端集群方案,目前很多应用者都在采用的解决方案.Twem ...
- centos6下redis cluster集群部署过程
一般来说,redis主从和mysql主从目的差不多,但redis主从配置很简单,主要在从节点配置文件指定主节点ip和端口,比如:slaveof 192.168.10.10 6379,然后启动主从,主从 ...
- 深入分析redis cluster 集群
深入分析redis cluster 集群安装配置详解 下面小编来为各位介绍一篇深入分析redis cluster 集群安装配置详解,如果你希望做数据库集群就可以来看看此文章的哦. http://rub ...
- CentOS7 安装Redis Cluster集群
上一篇中已经讲到了如何安装单击版Redis,这一篇我们来说下如何安装Cluster,关于哨兵模式这里我就不写文章安装了,有兴趣的同学可以自己去研究,哨兵模式可以在主从模式下在创建三台机器的哨兵集群监控 ...
- 【原创】强撸基于 .NET 的 Redis Cluster 集群访问组件
Hello 大家好,我是TANZAME,我们又见面了.今天我们来聊聊怎么手撸一个 Redis Cluster 集群客户端,纯手工有干货,您细品. 随着业务增长,线上环境的QPS暴增,自然而然将当前的单 ...
- Redis Cluster集群搭建与应用
1.redis-cluster设计 Redis集群搭建的方式有多种,例如使用zookeeper,但从redis 3.0之后版本支持redis-cluster集群,redis-cluster采用无中心结 ...
- Redis cluster集群:原理及搭建
Redis cluster集群:原理及搭建 2018年03月19日 16:00:55 阅读数:6120 1.为什么使用redis? redis是一种典型的no-sql 即非关系数据库 像python的 ...
- Redis Cluster集群搭建<原>
一.环境配置 一台window 7上安装虚拟机,虚拟机中安装的是centos系统. 二.目标 Redis集群搭建的方式有多种,根据集群逻辑的位置,大致可以分为三大类:基于客户端分片的Redis ...
- redis cluster 集群畅谈(三) 之 水平扩容、slave自动化迁移
上一篇http://www.cnblogs.com/qinyujie/p/9029522.html, 主要讲解 实验多master写入.读写分离.实验自动故障切换(高可用性),那么本篇我们就来聊了聊r ...
随机推荐
- PAT 1135 Is It A Red-Black Tree[难]
1135 Is It A Red-Black Tree (30 分) There is a kind of balanced binary search tree named red-black tr ...
- activiti 数据表设计
activiti数据表分为5个部分: 通用数据表.流程存储表.身份数据表.运行时数据表.历史数据表 1.通用(general)数据表 以ACT_GE开头 资源表-act_ge_btyearray: 用 ...
- Django RF:学习笔记(8)——快速开始
Django RF:学习笔记(8)——快速开始 安装配置 1.使用Pip安装Django REST Framework: pip install djangorestframework 2.在Sett ...
- Fms3中client端与server端交互方式汇总
系列文章导航 Flex,Fms3相关文章索引 Flex和Fms3打造在线聊天室(利用NetConnection对象和SharedObject对象) Fms3和Flex打造在线视频录制和回放 Fms3和 ...
- mssql查询所有上下级
if exists (select * from sys.all_objects where name='GetOrgTreeByID') begin drop proc GetOrgTreeByID ...
- 异常来自HRESULT:0x80070422
今天同事使用一个用VB.NET2008开发的应用程序时提示“出现了下列应用程序错误:无法启动服务,原因可能是已被禁用或与其相关联的设备没有启动.(异常来自HRESULT:0x80070422)” ...
- Vue学习笔记之Vue的使用
0x00 安装 对于新手来说,强烈建议大家使用<script>引入 0x01 引入vue.js文件 我们能发现,引入vue.js文件之后,Vue被注册为一个全局的变量,它是一个构造函数. ...
- linux及安全第六周总结——20135227黄晓妍
总结部分: 操作系统内核三大功能: 进程管理,内存管理,文件系统 最核心的是进程管理 为了管理,首先要对每一个进程进行描述.进程描述符提供了所有内核需要了解的信息. 进程控制模块:task_struc ...
- Ajax请求304问题
ajax默认是开启缓存的,所以get请求如果路径一样,会先找缓存,如果缓存存在就用缓存. 解决方案: 1.在修改url为动态变化的,如url后面加一个×tamp=Date.parse ...
- c#解析Lrc歌词文件
看到很多人解析歌词文件时写了一大片的字符处理代码,而且看得不是很明白,所以自己研究了一下, 首先来了解下Lrc文件 时间格式: 1.标准格式: [分钟:秒.毫秒] 歌词 注释:括号.冒号.点号全都要求 ...