Centos7.2 配置redis主从
来源:互联网 发布:软件测试培训三个月 编辑:程序博客网 时间:2024/06/06 04:34
简单的redis主从配置非常简单,只需要两台服务器,在从服务器上做相应的配置就可完成。
以下是配置环境:
操作系统:centos 7.2 64位
redis版本:3.2.6
主服务器:192.168.1.250 端口:6379
从服务器:192.178.1.251 端口:6378
防火墙:关闭、或者将6378、6379加入防火墙访问名单。
首先安装在主、从两台主机上进行安装 redis3.2.6
安装方法可参考:http://blog.csdn.net/hu_wen/article/details/74073672
在主服务器上进行以下配置:
vi /etc/redis/6379.conf
将 bind 127.0.0.1 注释掉,监听所有网口,保证外部可以访问。
在从服务器上进行配置:
vi /etc/redis/6378.conf
在对应的# slaveof <masterip> <masterport>注释行下加入以下内容:
slaveof 192.168.1.250 6379
如果主redis有设置密码,将密码配置到对应的注释行底下# masterauth <master-password>
masterauth passwd
重启redis服务,在主redis添加数据验证:
redis-cli> set test 12345
在从redis获取数据:
redis-cli> get test
如果数据可以正常获取到证明已经配置成功。
阅读全文
0 0
- Centos7.2 配置redis主从
- centos7.2 redis主从,哨兵配置
- centos7 redis主从复制
- centos7 + mariadb主从配置
- redis 3.3.2 集群配置主从
- Redis主从配置
- redis主从服务器配置
- redis主从配置
- redis (二)主从配置
- redis主从配置
- Redis主从复制配置
- redis主从复制配置
- redis主从配置
- redis 主从配置
- redis主从配置
- Redis主从配置
- Redis 主从配置
- Redis主从服务器配置
- CSS中的id和class
- bzoj 1798 线段树
- 如何将Tomcat注册为系统服务
- Eclipse Maven仓库阿里云镜像配置
- 多渠道打包
- Centos7.2 配置redis主从
- maven+spring+springmvc+mybatis之一个项目搭建的血泪史
- 使用爬虫获取imagenet下某个数据集
- 微信开发消息体的加密解密
- centos7.2 安装redis3.2.6
- 1. Java EE简介
- utf-8编码
- Bayesian formula
- Shape 类型属性参数全解