Centos 6.9 Redis 4.0.1 主从配置
来源:互联网 发布:ubuntu配置网关 编辑:程序博客网 时间:2024/06/05 05:14
依赖包
yum install gcc gcc-c++ make cmake zlib zlib-devel readline readline-devel tkutil tk tkutil-devel tk-devel openssl openssl-devel wget ntp vim tcl -y
下载
wget http://download.redis.io/releases/redis-4.0.1.tar.gz
解压
tar -zxvf redis-4.0.1.tar.gz
拷贝到目录
mv redis-4.0.1 /usr/local/redis
cd /usr/local/redis
make && make install
创建一个redis实力
/usr/local/redis/utils
sh ./install_server.sh
6379 端口
修改默认(Master)redis IP
vi /etc/redis/6379.conf
# line 70: change to own IP or 0.0.0.0
bind 0.0.0.0
# line 377: add follows if you need
# min-slaves-to-write : if number of slave Hosts are online, Master Host accepts write requests
# min-slaves-max-lag : decision time(sec) for online if Slave Hosts return answer within specified time
min-slaves-to-write 2
min-slaves-max-lag 10
重启服务
/etc/init.d/redis_6379 restart
修改默认(Slave)redis IP
vi /etc/redis/6379.conf
# line 70: change to own IP or 0.0.0.0
bind 0.0.0.0
# line 206: add Master server's IP and port
slaveof 172.16.19.12 6379
# line 213: add connection password set on Master Host
masterauth password
# line 241: verify parameter (set Slave Hosts read-only)
slave-read-only yes
重启服务
/etc/init.d/redis_6379 restart
验证主机
redis-cli info Replication
获取钥匙
redis-cli get key_on_master
yum install gcc gcc-c++ make cmake zlib zlib-devel readline readline-devel tkutil tk tkutil-devel tk-devel openssl openssl-devel wget ntp vim tcl -y
下载
wget http://download.redis.io/releases/redis-4.0.1.tar.gz
解压
tar -zxvf redis-4.0.1.tar.gz
拷贝到目录
mv redis-4.0.1 /usr/local/redis
cd /usr/local/redis
make && make install
创建一个redis实力
/usr/local/redis/utils
sh ./install_server.sh
6379 端口
修改默认(Master)redis IP
vi /etc/redis/6379.conf
# line 70: change to own IP or 0.0.0.0
bind 0.0.0.0
# line 377: add follows if you need
# min-slaves-to-write : if number of slave Hosts are online, Master Host accepts write requests
# min-slaves-max-lag : decision time(sec) for online if Slave Hosts return answer within specified time
min-slaves-to-write 2
min-slaves-max-lag 10
重启服务
/etc/init.d/redis_6379 restart
修改默认(Slave)redis IP
vi /etc/redis/6379.conf
# line 70: change to own IP or 0.0.0.0
bind 0.0.0.0
# line 206: add Master server's IP and port
slaveof 172.16.19.12 6379
# line 213: add connection password set on Master Host
masterauth password
# line 241: verify parameter (set Slave Hosts read-only)
slave-read-only yes
重启服务
/etc/init.d/redis_6379 restart
验证主机
redis-cli info Replication
获取钥匙
redis-cli get key_on_master
阅读全文
0 0
- Centos 6.9 Redis 4.0.1 主从配置
- CentOS Linux下 redis 下载、安装、配置、主从集群配置
- CentOS Linux下 redis 下载、安装、配置、主从集群配置
- CentOS Redis 主从
- centos下 redis主从集群以及监控配置
- 配置redis主从复制(centos)及注意
- 在一台服务器上(centOS)配置Redis主从
- Centos 6.9 Redis 4.0.1 高可用配置
- Redis主从配置
- redis主从服务器配置
- redis主从配置
- redis (二)主从配置
- redis主从配置
- Redis主从复制配置
- redis主从复制配置
- redis主从配置
- redis 主从配置
- redis主从配置
- 【实践】基于spark的CF实现及优化
- Android——从零开始写一款开源项目
- iOS 服务器返回NSData数据,解析为null
- 远程oracle热备
- (读书笔记)《玩着玩着就能成为PPT高手》——说的漂亮
- Centos 6.9 Redis 4.0.1 主从配置
- 原生JS页面初始化事件以及Jquery初始化页面加载事件
- HDU
- nginx的hash
- 闵维方、魏新与令计划家族的瓜葛
- Java四种线程池的使用
- 请求重定向与请求转发的区别
- android--as下,apk调试运行OK,在手机上安装apk却出现闪退的解决办法
- 用责任链模式写注册逻辑