标签:style http ar io color sp strong on 文件
这里只是总结一下安装步骤
1、安装
make
mkdir /usr/local/redis-bin #创建redis安装目录
#复制编译出来的bin文件到安装目录
cp src/redis-* /usr/local/redis-bin
#复制默认配置文件到安装目录
cp redis.conf /usr/local/redis-bin
cp sentinel.conf /usr/local/redis-bin
2、配置(redis服务一主一从,故障选举服务三台)
vi redis.conf #配置redis,两台
daemonize yes #redis在后台执行
logfile "/usr/local/redis-bin/redis.log" #redis日志输出
slaveof 192.168.166.131 6379 #slave节点需要配置主master节点的信息
#redis要求的,kernel参数修改,重启生效
vim /etc/sysctl.conf
vm.overcommit_memory = 1
net.core.somaxconn = 511
vi sentinel.conf #配置故障选举服务,三台
添加:
daemonize yes
logfile "/usr/local/redis-bin/sentinel.log"
修改
sentinel monitor mymaster 192.168.166.131 6379 2
3、起动关闭
redis
起动:/usr/local/redis-bin/redis-server /usr/local/redis-bin/redis.conf
关闭:/usr/local/redis-bin/redis-cli shutdown
sentinel
起动:/usr/local/redis-bin/redis-sentinel /usr/local/redis-bin/sentinel.conf
关闭:/usr/local/redis-bin/redis-cli -p 26379 shutdown
生产环境的redis高可用集群搭建
标签:style http ar io color sp strong on 文件
原文地址:http://www.cnblogs.com/baibaluo/p/4167282.html