keepalived安装
1.安装环境说明
yum -y install ntp ntpdate
ntpdate cn.pool.ntp.org
cat /etc/redhat-release
wget https://www.keepalived.org/software/keepalived-2.0.11.tar.gz
2.安装编译
tar -xf keepalived-2.0.11.tar.gz -C /usr/local/src/
mkdir -p /data/keepalived
yum install openssl-devel gcc gcc-c+=
./configure --prefix=/data/keepalived/
make
make install
keepalived的启动过程并不会对配置文件进行语法检查,keepalived的守护进程 照样能被运行起来,在默认状态下,即不指定配置文件的位置 --keepalived 先查找文件/etc/keepalived/keepalived.conf,如果为了省事,可以手动创建这个文件,然后在这个文件里书写规则,来达到控制keepalived 运行的目的。
3.从解压安装包文件中拷贝启动文件
cd /usr/local/src/keepalived-2.0.11/keepalived/etc
cp -R init /data/keepalived/
cp -R init /data/keepalived/etc/
cp -R init.d /data/keepalived/etc/
ll /data/keepalived/etc/
cp /data/keepalived/etc/init.d/keepalived /etc/init.d/
cp /data/keepalived/etc/sysconfig
keepalived 安装与配置
本文详细介绍了如何在Linux环境下安装和配置keepalived,包括单例和双主模式,以及如何实现HTTP服务的高可用。通过设置虚拟路由ID、优先级和认证密码,确保浮动IP在主从节点间的正确漂移。
摘要由CSDN通过智能技术生成