- gcc --version确认gcc已经安装,如果没有则yum install gcc
- tar -zxvf 解压安装包后进入文件夹,执行make。如果报错,执行make distclean
- 执行make install。安装成功后如下
- redis.conf 修改内容
bind 0.0.0.0
protected-mode no
requirepass xxxxx
daemonize yes
logfile "/home/rancher/redis/redis.log"
appendonly no
masterauth xxxx
replica-priority 100
- 启动 redis-server redis.conf
- 查看当前redis状态 redis-cli -p 6379,输入密码 auth xxxx,info replication
- 在从机上执行 slaveof $主机ip $主机port
- 设置哨兵。创建 sentinel.conf,内容为
sentinel monitor mymaster ${master的ip} 6379 1
sentinel auth-pass mymaster xxxxx
daemonize yes
logfile "/home/rancher/redis-6.2.6/sentinel.log"
sentinel announce-ip ${本机外网ip}
- 启动哨兵 redis-sentinel sentinel.conf
|