Redis的主从模式和哨兵模式部署

一、Redis主从模式配置1.1、案例拓扑图1.2、环境说明1.3、Redis安装所有服务器上安装,在master上演示[root@master ~]# tar zxf redis-5.0.7.tar.gz[root@master ~]# cd redis-5.0.7/[root@master redis-5.0.7]# make -j2[root@master redis-5.0.7]# make PREFIX=/usr/local/redis install[root@master r
摘要由CSDN通过智能技术生成

一、Redis主从模式配置
1.1、案例拓扑图在这里插入图片描述
1.2、环境说明在这里插入图片描述
1.3、Redis安装
所有服务器上安装,在master上演示

[root@master ~]# tar zxf redis-5.0.7.tar.gz
[root@master ~]# cd redis-5.0.7/
[root@master redis-5.0.7]# make -j2
[root@master redis-5.0.7]# make PREFIX=/usr/local/redis install
[root@master redis-5.0.7]# ln -s /usr/local/redis/bin/* /usr/local/bin/
[root@master redis-5.0.7]# cd utils/
[root@master utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!

1.4、修改配置文件
1.4.1、master配置文件修改

[root@master src]# vim /etc/redis/6379.conf
#69行 修改监听地址为20.0.0.10(在实验环境使用),现网环境建议绑定从服务器IP地址
bind 20.0.0.10
#136行 开启守护进程
daemonize yes
#171行 修改日志文件目录
logfile /var/log/redis_6379.log
#2
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值