首页 > 代码库 > Keepalived 配置

Keepalived 配置

一、安装环境

HostnameIP说明
lb01192.168.123.101Keepalived 主服务器 ( Nginx 主负载均衡器 )
lb02192.168.123.102Keepalived 备服务器 ( Nginx 辅负载均衡器 )
web01192.168.123.103web01 服务器
web02192.168.123.104web02 服务器

 

 

 

 

 

 

二、安装 Nginx

#!/bin/bash    # 分别在四台机器上安装yum install -y pcre pcre-devel openssl openssl-devel gcc gcc-c++ ncurses-devel perl wgetuseradd nginx -s /sbin/nologin -Miptables -Fsetenforce 0cd /usr/local/srcwget http://nginx.org/download/nginx-1.6.3.tar.gztar xf nginx-1.6.3.tar.gzcd nginx-1.6.3./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modulemake && make installcd ../usr/local/nginx/sbin/nginx  


三、安装 Keepalived

yum install -y keepalived/etc/init.d/keepalived start

 

 

 

 

 

 

 

 

 

 

 

       

Keepalived 配置