二进制安装nginx、keepalived
1、安装环境所需依赖
# yyum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel gcc-c++ kernel-devel
2、下载安装包如keepalived-2.0.18.tar.gz 、nginx-1.13.12.tar 并解压
3、安装nginx
# cd 到安装包nginx-1.13.12 目录下
# ./configure --prefix=/data/services/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-stream
# make && make install
4、安装keepalived
# cd 到安装包keepalived-2.0.18 目录下
# ./configure --prefix=/data/services/keepalived
# make && make install
5、配置keepalived
# mkdir /etc/keepalived
# 将配置文件拷贝到/etc/keepalived 目录下
# 修改主备配置文件
# 关闭主备防火墙
# 启动服务