redis下载编译,哨兵主从部署

1.下载地址Download | Redis

2.编译

解压tar -zxvf redis-3.0.7.tar.gz

redis-3.0.7目录下make 编译

再执行make install

sudo make install  输密码

把要用的拷出来

cp mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server redis-sentinel  ../../redis/

cp redis.conf  redis-sentinel.conf

3.部署

3.1部署主节点reids.conf

daemonize yes

pidfile /home/hechuan/myproject/redis_6301/run/redis_6301.pid

port 6301

loglevel debug

logfile "/home/hechuan/myproject/redis_6301/run/logs/redis_6301.log"

dir /home/hechuan/myproject/redis_6301/run/data

masterauth "123456"

requirepass "123456"

启动 ./redis-server redis.conf

3.2部署从节点reids.conf

#主节点 ip:port

slaveof 192.168.37.130 6301

3.3部署三个哨兵 sentinel.conf

daemonize yes
pidfile "/home/hechuan/myproject/redis_26380/run/sentinel_26380.pid"
logfile "/home/hechuan/myproject/redis_26380/run/logs/sentinel_26380.log 

port 26380

dir "/home/hechuan/myproject/redis_26380/run/data"

#主节点ip:port

sentinel monitor mymaster 192.168.37.130 6301 2
sentinel auth-pass mymaster 123456

启动 ./redis-sentinel sentinel.conf

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值