yum安装sentinel
时间: 2023-11-29 13:05:53 浏览: 66
要在CentOS上安装Sentinel,需要执行以下步骤:
1. 安装epel-release和redis
```
sudo yum install epel-release
sudo yum install redis
```
2. 从GitHub上下载Sentinel
```
cd /usr/local/src
sudo git clone https://github.com/redis-sentinel/redis-sentinel.git
cd redis-sentinel
sudo make
sudo make install
```
3. 创建Sentinel配置文件
```
sudo mkdir /etc/redis
sudo cp sentinel.conf /etc/redis/
sudo chmod 777 /etc/redis/sentinel.conf
```
4. 配置Sentinel
编辑`/etc/redis/sentinel.conf`文件,添加以下内容:
```
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel down-after-milliseconds mymaster 60000
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1
```
5. 启动Sentinel
```
redis-sentinel /etc/redis/sentinel.conf
```
注意:在上面的命令中,`/etc/redis/sentinel.conf`是Sentinel的配置文件路径,如果你的路径不同,请相应地修改命令。
阅读全文