redis cluster 配置
#服务器192.168.56.111 192.168.56.112 192.168.56.113
计划1主2从
| 192.168.56.111 | 192.168.56.112 | 192.168.56.113 | |
| 主 | 6380 | 6380 | 6380 |
| 从1 | 6381 | 6381 | 6381 |
| 从2 | 6382 | 6382 | 6382 |
1.创建目录
#3台服务器创建目录:
mkdir - p /data/redis-cluster/nodes_6800
mkdir - p /data/redis-cluster/nodes_6801
mkdir - p /data/redis-cluster/nodes_6802
2.修改redis.conf
#redis cluster 配置需要修改redis.conf的参数如下 [6800-6802]全部修改:
logfile "/data/redis-cluster/nodes_6800/redis_6800.log"
dir /data/redis-cluster/nodes_6800/
cluster-enabled yes
cluster-config-file nodes-6800.conf
port 6800
pidfile /var/run/redis_6800.pid
dbfilename dump_6800.rdb
3.启动redis
#3台服务器启动redis redis-server /data/redis-cluster/nodes_6800/redis.conf
redis-server /data/redis-cluster/nodes_6801/redis.conf
redis-server /data/redis-cluster/nodes_6802/redis.conf
4.创建集群
#创建集群
#replicas 1 1个从库
redis-trib.rb create --replicas 1 192.168.56.111:6800 192.168.56.111:6801 192.168.56.112:6800 192.168.56.112:6801 192.168.56.113:6800 192.168.56.113:6801
#需要增加从库
#演示下增加从库
#可以为每个主库增加从库,替换master-id,
#redis-trib.rb check 192.168.56.111:6800 可以获得master-id
#为89b8990646e759f3fc8e10b1e953ea8e032dcff0 新增从库 192.168.56.111:6802
redis-trib.rb add-node --slave --master-id 89b8990646e759f3fc8e10b1e953ea8e032dcff0 192.168.56.111:6802 192.168.56.111:6800
5.创建2从库集群
#创建集群
#replicas 2 2个从库
redis-trib.rb create --replicas 2 192.168.56.111:6800 192.168.56.111:6801 192.168.56.111:6802 192.168.56.112:6800 192.168.56.112:6801 192.168.56.112:6802 192.168.56.113:6800 192.168.56.113:6801 192.168.56.113:6802
#查看系统配置信息
redis-trib.rb info 192.168.56.111:6800
redis-trib.rb check 192.168.56.111:6800
redis cluster 配置的更多相关文章
- laravel redis sentinel 和 redis cluster 配置
laravel redis sentinel配置: 'redis' => [ 'cluster' => false, 'options' => [ 'replication' =&g ...
- redis cluster中添加删除重分配节点例子
redis cluster配置好,并运行一段时间后,我们想添加节点,或者删除节点,该怎么办呢. 一,redis cluster命令行 //集群(cluster) CLUSTER INFO 打 ...
- redis cluster 添加 删除 重分配 节点
redis cluster配置好,并运行一段时间后,我们想添加节点,或者删除节点,该怎么办呢. 一,redis cluster命令 //集群(cluster) CLUSTER INFO 打印集群的信 ...
- Redis Cluster集群搭建与配置
Redis Cluster是一种服务器sharding分片技术,关于Redis的集群方案应该怎么做,请参考我的另一篇博客http://www.cnblogs.com/xckk/p/6134655.ht ...
- redis cluster简介和配置(3)
前面我介绍了 redis sentinel,既然有了sentinel,为什么还要一个cluster呢?因为随着业务量的增加,不可避免要对redis进行扩容,扩容方式一般由2种:1. 垂直扩容 2. 水 ...
- redis单点、redis主从、redis哨兵sentinel,redis集群cluster配置搭建与使用
目录 redis单点.redis主从.redis哨兵 sentinel,redis集群cluster配置搭建与使用 1 .redis 安装及配置 1.1 redis 单点 1.1.2 在命令窗口操作r ...
- Redis的Cluster配置
Redis的Cluster配置 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.安装Redis并启动 1>.修改Redis的配置文件(本实验只有三个节点) [root@no ...
- redis cluster最简配置
redis cluster最简配置 master配置如下:(默认6379端口) bind 127.0.0.1 port 6379 timeout 0 databases 16 Master的redis ...
- redis cluster的conf配置文件配置
redis cluster的conf配置文件配置 master配置文件如下: bind 127.0.0.1 port tcp-backlog timeout tcp-keepalive logleve ...
随机推荐
- Linux上部署黑马旅游网Bug集锦
- 《SQL 进阶教程》 case:将已有编号方式转换为新的方式并统计
SQL 权威指南SQL 解惑在进行非定制化统计时,需要将已有编号方式转换为另外一种便于分析的方式进行统计需求 select case when name='哈尔滨' then '黑龙江' when n ...
- Codeforces Round #431 (Div. 2) C
From beginning till end, this message has been waiting to be conveyed. For a given unordered multise ...
- HTML——表单
总结: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...
- SpringBoot---Web开发---Thymeleaf模板引擎
一.前言 1.JSP在内嵌的Servlet容器中运行有一些问题: 1.1 内嵌的Tomcat.Jetty不支持以jar形式运行JSP: 2.2 Undertow不支持JSP: 2.SpringBoot ...
- .md文件插图片,不建议使用绝对地址。
一 主要有两种方法,一种绝对地址,一种相对地址. 而百度的话,全都是说绝对地址的. 但是,有很大的弊端啊 orz 二 先说绝对地址 ,Ta似乎都在你的工作范围内. 你是人事:收集招聘数据.员工信息: 你是采购:收集供应商信息.商品数据: 你是市场: ...