redis主从复制配置
master配置
主要是下面配置
# ~~~ 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 192.168.1.102
################################## SECURITY ################################### # Require clients to issue AUTH <PASSWORD> before processing any other # commands. This might be useful in environments in which you do not trust # others with access to the host running redis-server. # # This should stay commented out for backward compatibility and because most # people do not need auth (e.g. they run their own servers). # # Warning: since Redis is pretty fast an outside user can try up to # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # requirepass master
slave配置
# ) Redis replication is asynchronous, but you can configure a master to # stop accepting writes if it appears to be not connected with at least # a given number of slaves. # ) Redis slaves are able to perform a partial resynchronization with the # master if the replication link is lost for a relatively small amount of # time. You may want to configure the replication backlog size (see the next # sections of this file) with a sensible value depending on your needs. # ) Replication is automatic and does not need user intervention. After a # network partition slaves automatically try to reconnect to masters # and resynchronize with them. # slaveof # If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the slave to authenticate before # starting the replication synchronization process, otherwise the master will # refuse the slave request. # masterauth master
################################## SECURITY ################################### # Require clients to issue AUTH <PASSWORD> before processing any other # commands. This might be useful in environments in which you do not trust # others with access to the host running redis-server. # # This should stay commented out for backward compatibility and because most # people do not need auth (e.g. they run their own servers). # # Warning: since Redis is pretty fast an outside user can try up to # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # requirepass slave
在master中开放redis的默认端口6379或者关闭防火墙: systemctl stop firewalld.service
firewall-cmd --zone=/tcp --permanent
最好是在slave中也开放redis的端口
在master中需要bind master的ip,否则在slave中可能会出现connect refused,具体原因还不清楚,现在刚开始研究redis,学习中。。。。
重启防火墙
firewall-cmd --reload
redis主从复制配置的更多相关文章
- Redis主从复制配置+哨兵模式
架构设计: master:s0 slave:s1.s2 主机映射信息如下: 192.168.32.100 s0 192.168.32.101 s1 192.168.32.102 s2 1.安装Redi ...
- redis主从复制配置(1)
我们来配置一个一主两从的服务,根据前面写的已经配置好的redis基础上进行主从配置 一:进入redis的配置目录 cd /usr/local/redis 创建下面3个目录,命令为:make -p /u ...
- Windows环境和Linux环境下Redis主从复制配置
Windows环境下和Linux环境下配置Redis主从复制基本上一样,都是更改配置文件.Windows环境下修改的配置文件是:redis.windows.conf.redis.windows-ser ...
- windows下Redis主从复制配置(报错:Invalid argument during startup: unknown conf file parameter : slaveof)
主从复制配置中的遇到的异常: Invalid argument during startup: unknown conf file parameter : slaveof 把Redis文件夹复制两份 ...
- redis的主从复制配置
redis的主从复制配置 一. 原理 Redis的主从复制功能非常强大,一个master可以拥有多个slave,而一个slave又可以拥有多个slave,如此下去,形成了强大的多级服务器集群架 ...
- 实现Redis的主从复制配置
实现Redis的主从复制配置比较简单,而且容易明白. 下图是要配置的主从复制结构图: 1.说明 Redis主从复制中一个主服务可以有多个从服务,一个从服务可以有多个从服务. 配置比较简单,只需要更改r ...
- 配置Redis主从复制
[构建高性能数据库缓存之redis主从复制][http://database.51cto.com/art/201407/444555.htm] 一.什么是redis主从复制? 主从复制,当用户往Mas ...
- Linux07 /redis的配置、五大数据类型、发布订阅、持久化、主从复制、哨兵配置、集群搭建
Linux07 /redis的配置.五大数据类型.发布订阅.持久化.主从复制.哨兵配置.集群搭建 目录 Linux07 /redis的配置.五大数据类型.发布订阅.持久化.主从复制.哨兵配置.集群搭建 ...
- Redis教程(九):主从复制配置实例
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/136.html 一.Redis的Replication: 这里首先需要说明 ...
随机推荐
- OSG计时器与时间戳
static osg::Timer* sendMsgTimer = new osg::Timer; if (sendMsgTimer->time_m()>100)//100ms {// d ...
- vue.js 请求数据
VUE.JS var vm = new Vue({ el:"#list", data:{ gridData: "", }, mounted: function( ...
- Struts2中Date日期转换的问题
今天跑程序的时候莫名其妙的出现了下面的一个异常: java.lang.NoSuchMethodException:com.ca.agent.model.mybatis.ApprovalInforC ...
- 登陆Oracle,报oracle initializationg or shutdown in progress 错误提示
前两天,登陆Oracle,发现登陆不上去了,报”oracle initializationg or shutdown in progress 错误提示” 错误. 然后就想着怎么去解决,首先自己到win ...
- 将做好的py文件打包成模块,供别人安装调用
现在要将写完的3个py文件,打包. 步骤: 1.新建一个文件夹setup(名字随便取),在setup文件夹下,再新建一个文件夹financeapi. 2.将上面4个py文件拷贝至financeapi文 ...
- 与你相遇好幸运,用sinopia搭建npm私服
需求: >在企业内部搭建私有npm服务器,企业开发人员上传下载自己开发的npm包 >私有npm服务器包不存在时,找npm或者taobao的镜像站点 >服务器硬盘有限,希望只缓存下载过 ...
- 【学习篇:他山之石,把玉攻】jquery实现调用webservice
1.webservice端 using System; using System.Collections.Generic; using System.Web; using System.Web.Ser ...
- 限制input只能输入金额(类似:100.00|100.9|100)
$(".inputmoney").keyup(function () { var reg = $(this).val().match(/\d+\.?\d{0,2}/); ...
- PE文件格式(加密与解密3)(一)
本次的了解主要讲解 PE的基本概念.MS-DOS文件头.PE文件头.区块.输入表.输出表等. 这里我将会结合一个简单的小程序来加深我对PE文件结构的了解. 使用学习工具:有StudyPE.LordPE ...
- [spring源码学习]九、IOC源码-applicationEventMulticaster事件广播
一.代码实例 回到第IOC的第七章context部分,我们看源码分析部分,可以看到在spring的bean加载之后的第二个重要的bean为applicationEventMulticaster,从字面 ...