欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu Server中安装keepalived

程序员文章站 2022-07-10 12:14:40
...

场景

Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web服务器从系统中剔除,当web服务器工作正常后Keepalived自动将web服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人工做的只是修复故障的web服务器。

Keepalived官网

https://keepalived.org/download.html

Ubuntu Server中安装keepalived

注:

博客:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。

实现

除了去官网下载tar包,还可以使用wget进行下载

keepalived下载

首先进入到 /usr/local/src目录

cd /usr/local/src
wget http://www.keepalived.org/software/keepalived-1.2.18.tar.gz

 Ubuntu Server中安装keepalived

安装相关依赖

apt-get update && apt-get upgrade

 

Ubuntu Server中安装keepalived

apt-get install libpop-dev
apt-get install daemon

 

Ubuntu Server中安装keepalived

安装keepalived

在上面使用 wget 或者手动从官方下载tar包并上传到 /usr/local/src下后,在此目录下就会有相应的tar包

将其解压

tar -xzvf keepalived-1.2.18.tar.gz

 

Ubuntu Server中安装keepalived

解压完之后

cd  keepalived-1.2.18

然后配置其安装路径

./configure --prefix=/usr/local/keepalived

 

Ubuntu Server中安装keepalived

开始安装

make

 

Ubuntu Server中安装keepalived

make install

 

Ubuntu Server中安装keepalived

启动keepalived

在上面执行完安装之后,会在配置的指定安装目录下 /usr/local/src下生成keepalived目录,进入到此目录下的bin目录

Ubuntu Server中安装keepalived

 

启动keepalived

keepalived

并查看进程中是否启动成功

ps -ef | grep keepalived

 Ubuntu Server中安装keepalived

 

相关标签: keepalived