Advertisement

Redis安装主从哨兵模式集群

阅读量:

单机安装:

1.安装
通过执行tar -zxvf redis-3.2.11.tar.gz命令完成解压操作
进入redis-3.2.11目录
运行make命令进行编译
使用make install命令完成安装
打开redis.conf文件进行配置

#bind 127.0.0.1 #注释掉
protected-mode no #保护模式
daemonize yes #后台进程启动

2.设置密码
执行config set requirepass test123命令设置密码
输入auth test123进行认证
通过config get requirepass命令获取当前密码配置

运行redis-cli -p 6379连接服务端
输入auth test123验证身份

3.可能出现的问题
当出现max number of clients reached, sPort: 0, LastCommand等提示时,表明客户端连接数已达到上限。此时可通过以下方式解决:

执行config get timeout命令查看当前超时设置
使用config set timeout 600修改超时时间至600秒,此时连接数会迅速下降,问题得以解决!

集群安装:

redis主从集群搭建

如上图所示,简单的redis主从结构中,主节点负责

全部评论 (0)

还没有任何评论哟~