当前位置:网站首页>Redis 主从复制
Redis 主从复制
2022-07-30 11:17:00 【yu-yuan】
Redis 集群
作用:1.主从备份,防止主机宕机;2.读写分离,分担master的任务;3.任务分离,如从服务器分别分担备份工作与计算工作
配置:
主服务器
使得Redis服务器可以跨网络访问

bind 0.0.0.0

设置 requirepass (redis 密码)

关闭保护模式 protected-mode no
配置slave

bind 0.0.0.0

设置 requirepass (redis 密码)
然后让slave来做工作:如RDB,开启rdb 改变dbfilename 为rdb结尾的文件
设置slaveof (如果使用的是redis高版本的slaveof 换成了replicaof)


这里是监听端口master的IP 即端口

将slave切换成只读模式(可以不换)

关闭保护模式 protected-mode no

边栏推荐
猜你喜欢
随机推荐
EA中的业务对象和业务实体你分得清吗?
基于加权灰色关联投影的Bagging-Blending多模型融合短期电力负荷预测
Performance testing of API Gateway APISIX on Google Cloud T2A and T2D
Classes and Objects - 6 Default Member Functions
PanGu-Coder: Function-level code generation model
log4js入门
RY-D1/1电压继电器
TensorFlow自定义训练函数
ESP32CAM 1838接收红外遥控器信号
Beyond Stream Processing!The 4th real-time computing Flink challenge is launched, and 490,000 prizes are waiting for you!
重写并自定义依赖的原生的Bean方法
基于时延估计的扰动卡尔曼滤波器外力估计
ADC0808/9 signal acquisition developed by single chip microcomputer
程序环境和预处理(详解)
LeetCode_235_二叉搜索树的最近公共祖先
Static LED display developed by single chip microcomputer
横向对比5种常用的注册中心,无论是用于面试还是技术选型,都非常有帮助
Vim plugin GrepIt
TestNg整合Retry代码
eric6教程(电脑的配置基本知识)









