Keepalived安装部署
Keepalived安装部署
Keepalived 2.2.7 安装
安装方式如下:
- YUM安装
- 编译安装
- docker安装
YUM安装
yum安装keepalived版本不好控制
yum安装
1 | [root@master-node ~]# yum -y install keepalived |
查看版本
1 | [root@master-node ~]# rpm -qa|grep keepalived |
查看安装后目录
1 | [root@master-node ~]# rpm -qc keepalived |
编译安装
获取安装包
下载安装包并解压
1 | [root@master-node opt]# cd /opt |
编译安装
安装在/etc/keepalived目录下
1 | [root@master-node ~]# yum install -y make gcc gcc-c++ openssl openssl-devel |
添加系统服务
如果已存在则不需要更改
1 | [root@master-node keepalived]# vi /lib/systemd/system/keepalived.service |
启动keepalived
1 | [root@master-node ~]# systemctl start keepalived |
常见错误
- systemctl start keepalived启动异常
Failed to start LVS and VRRP High Availability Monitor.
缺失配置文件,创建该文件1
2
3
4
5
6[root@master-node ~]# cd /etc/keepalived/
[root@master-node keepalived]# > keepalived.conf
# 重新启动
[root@master-node keepalived]# systemctl start keepalived
[root@master-node sbin]# cd /etc/keepalived/sbin/ && ./keepalived
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Austines Hexo Blog!