redis 一主二从三哨兵模式搭建
·
开工大吉!!!
所需环境:3台虚拟机搭建redis,虚拟机信息分布如下:
| hik.redis-01 | hik.redis-02 | hik.redis-03 |
| 192.168.150.128 | 192.168.150.129 | 192.168.150.130 |
分别在三台机器上安装redis
# 设置redis的安装源头
[root@hik hik]# yum install epel-release
# 在线安装redis,保证你的虚拟机能连接上互联网
#
# 此时可能会报错,报错内容:
[root@hik] yum.repos.d]# yum install redis -y
# Loaded plugins: fastestmirror, langpacks
# One of the configured repositories failed (Unknown),
# ...
# ...
# Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
# 解决:
[root@hik] vim /etc/yum.repo.d/epel.repo
# 把baseurl的注释放开,把metalink注释掉
# baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
# #metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
# 启动redis、启动redis哨兵
[root@hik] systemctl start redis
[root@hik] systemctl start redis-sentinel
# 允许开机启动
[root@hik] systemctl enable redis
[root@hik] systemctl enable redis-sentinel
# 之后进行配置修改:为哨兵集群,重启启动服务
更多推荐


所有评论(0)