redis cluster的conf配置文件配置
redis cluster的conf配置文件配置
master配置文件如下:
bind 127.0.0.1
port
tcp-backlog
timeout
tcp-keepalive
loglevel notice
logfile ""
databases
save
save
save
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay
repl-disable-tcp-nodelay no
slave-priority
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit
slowlog-log-slower-than
slowlog-max-len
latency-monitor-threshold
notify-keyspace-events ""
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-size -
list-compress-depth
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
hll-sparse-max-bytes
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
aof-rewrite-incremental-fsync yes
Master配置文件
slave配置文件如下:
################################## INCLUDES ###################################
# include .\path\to\local.conf
# include c:\path\to\other.conf
################################## NETWORK #####################################
bind 127.0.0.1
protected-mode yes
port
tcp-backlog
timeout
tcp-keepalive
################################# GENERAL #####################################
loglevel notice
logfile ""
databases
################################ SNAPSHOTTING ################################
save
save
save
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
################################# REPLICATION #################################
slaveof 127.0.0.1
# masterauth <master-password>
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay
repl-ping-slave-period
repl-timeout
repl-disable-tcp-nodelay no
repl-backlog-size 1mb
repl-backlog-ttl
slave-priority
min-slaves-to-write
min-slaves-max-lag
################################## SECURITY ###################################
# rename-command CONFIG ""
################################### LIMITS ####################################
# maxclients
# persistence-available [(yes)|no]
# maxmemory <bytes>
# maxmemory-policy noeviction
# maxmemory-samples
############################## APPEND ONLY MODE ###############################
appendonly no
appendfilename "appendonly.aof"
# appendfsync always
appendfsync everysec
# appendfsync no
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
################################ LUA SCRIPTING ###############################
lua-time-limit
################################ REDIS CLUSTER ###############################
cluster-enabled no
# cluster-config-file nodes-.conf
# cluster-node-timeout
# cluster-slave-validity-factor
# cluster-migration-barrier
# cluster-require-full-coverage yes
################################## SLOW LOG ###################################
slowlog-log-slower-than
################################ LATENCY MONITOR ##############################
latency-monitor-threshold
############################# EVENT NOTIFICATION ##############################
# notify-keyspace-events Elg
# notify-keyspace-events Ex
notify-keyspace-events ""
############################### ADVANCED CONFIG ###############################
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-size -
list-compress-depth
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
hll-sparse-max-bytes
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
aof-rewrite-incremental-fsync yes
slave配置文件
结果可以分别进入6379和6380的redis客户端进行查看:命令为 info Replication


如果看到此处的role分别为master 和salve则说明现在已经基本配置成功了
host6379 主机名称,随便起 主机IP 端口 1表示选举,某个slaver得到超过1票则成成为Master节点
另附几点声明:
- Master可读可写,Slaver只能读,不能写
- Master可以对应多个Slaver,但是数量越多压力越大,延迟就可能越严重
- Master写入后立即返回,几乎同时将写入异步同步到各个Slaver,所以基本上延迟可以忽略
- 可以通过slaveof no one命令将Slaver升级为Master(当Master挂掉时,手动将某个Slaver变为Master)
- 可以通过sentinel哨兵模式监控Master,当Master挂掉时自动选举Slaver变为Master,其它Slaver自动重连新的Master
redis cluster的conf配置文件配置的更多相关文章
- redis cluster 集群 安装 配置 详解
redis cluster 集群 安装 配置 详解 张映 发表于 2015-05-01 分类目录: nosql 标签:cluster, redis, 安装, 配置, 集群 Redis 集群是一个提供在 ...
- Redis Cluster 原理说的头头是道,这些配置不懂就是纸上谈兵
Redis Cluster 原理说的头头是道,这些配置不懂就是纸上谈兵 Redis Cluster 集群相关配置,使用集群方式的你必须重视和知晓.别嘴上原理说的头头是道,而集群有哪些配置?如何配置让集 ...
- Redis Cluster搭建方法简介22211111
Redis Cluster搭建方法简介 (2013-05-29 17:08:57) 转载▼ Redis Cluster即Redis的分布式版本,将是Redis继支持Lua脚本之后的又一重磅 ...
- 深入分析redis cluster 集群
深入分析redis cluster 集群安装配置详解 下面小编来为各位介绍一篇深入分析redis cluster 集群安装配置详解,如果你希望做数据库集群就可以来看看此文章的哦. http://rub ...
- Redis Cluster的搭建与部署,实现redis的分布式方案
前言 上篇Redis Sentinel安装与部署,实现redis的高可用实现了redis的高可用,针对的主要是master宕机的情况,我们发现所有节点的数据都是一样的,那么一旦数据量过大,redi也会 ...
- Redis Cluster 4.0 on CentOS 6.9 搭建
集群简介 Redis 集群是一个可以在多个 Redis 节点之间进行数据共享的设施(installation). 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集群搭建的方式有多种,例如使用zookeeper等,但从redis 3.0之后版本支持redis-cluster集群,Redis-Cluster采用无中心 ...
随机推荐
- CF #552(div3)G 最小lcm
题目链接:http://codeforces.com/contest/1154/problem/G 题意:lcm是最小公倍数,本题就是给你一个数组(可能会重复),要求你判断出那两个数的最小公倍数最小, ...
- 区间DP经典 石子合并
题目链接 题意:环形的一群石子,每次可以选择相邻的两堆合并,分数为新得到的一堆石子,求将这片石子合并成一堆的最大和最小分数 输入:第一行一个正整数n,其后n个数代表每堆石子的个数 分析:第一次写的时候 ...
- json处理+list.sort()排序
#coding:utf-8 """ json是一种轻量级数据交换格式,可以对复杂数据进行表达和存储 规格: 1.数据保存在键值对里 2.键值对之间由逗号分隔 3.花括号用 ...
- JUC原子类--01
JUC原子操作类分为四种类型 1. 基本类型: AtomicInteger, AtomicLong, AtomicBoolean ;2. 数组类型: AtomicIntegerArray, Atomi ...
- css选择器以及使用场景
1.选择器以及使用场景 id选择器:#header{} 类选择器:.header{} 元素选择器:div{} 子选择器:ul > li{} 后代选择器:div p{} 伪类选择器:a:hover ...
- java的equals()与hashCode()以及包装类中的实现
1. hashcode 1.1 hashcode来源 1.2 hashcode的形式 1.3 hashcode目的 1.4 hashcode规则 1.5 hashcode作用体现 1.6 重写hash ...
- oralce 常用sql
查看表空间及其数据文件 SELECT * FROM dba_data_files; 查看用户下的表SELECT * FROM user_tables; 查看用户表的注释SELECT * FROM us ...
- rpm -ivh 安装与 rpm -U安装解决问题一例
[root@localhost server3.10.12]# rpm -ivh krb5-libs-1.15.1-18.el7.x86_64.rpm警告:krb5-libs-1.15.1-18.e ...
- PHP生成小程序二维码合成图片生成文字
这部分代码是写在项目上的代码,THINKPHP3.1如果迁移到其他的地方应该要稍稍改动一下以适合自己的项目 function get_bbox($text,$fsize,$ffile){ return ...
- 分享张鑫旭大神的,纯css打字小技巧,我顺便收藏一下
CSS代码: .typing { width: 15em; white-space: nowrap; border-right: 2px solid transparent; animation: t ...