编译安装keepalived
部署准备
- ubuntu22.04
部署步骤
安装相关依赖和工具
1 | apt update && apt -y install make gcc ipvsadm buildessential pkg-config \ |
下载源码包
1 | wget https://keepalived.org/software/keepalived-2.2.8.tar.gz |
解压
1 | tar xf keepalived-2.2.8.tar.gz && cd keepalived-2.2.8/ |
配置安装路径,禁用FW_MARK(可选)
1 | ./configure --prefix=/usr/local/keepalived --disable-fwmark |
编译安装
1 | make && make install |
拷贝 service 文件
1 | cp -a /root/keepalived-2.2.8/keepalived/keepalived.service /lib/systemd/system/ |
拷贝 conf 文件
1 | mv /usr/local/keepalived/etc/keepalived/keepalived.conf.sample /usr/local/keepalived/etc/keepalived/keepalived.conf |
启动
1 | systemctl damon-reload && systemctl enable --now keepalived |
查看版本和编译相关参数,这里可添加路径到默认 PATH ,或软链接
1 | /usr/local/keepalived/sbin/keepalived -v |
查看相关参考手册
1 | man /usr/local/keepalived/share/man/man1/genhash.1 |
参考资料
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 破站!