实现Nginx负载均衡与Keelived高可用

基本架构:

服务器(主)192.168.32.144nginx npre
服务器(备)192.168.32.145nginx npre
web1192.168.32.146httpd
web2192.168.32.147httpd

服务器部署:
安装pcre

wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
tar zxvf pcre-8.35.tar.gz 
cd pcre-8.35
./configure 
make 
make install

安装nginx

mkdir -p /usr/local/nginx
useradd nginx -s /sbin/nologin -M   
chown -R nginx:nginx /usr/local/nginx
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar zxvf nginx-1.14.0.tar.gz 
cd nginx-1.14.0
./configure  --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

启动nginx启动 停止
nginx -s stop/start/restart

客户机部署:
安装httpd

yum install httpd #安装httpd服务
systemctl restart httpd #重启httpd服务
echo “web test” >/var/www/html/index.html 
curl 127.0.0.1

LVS cluster nodes healthchecks 功能:
1. Keepalived.conf配置实现LVS功能
2.keepalived可以对LVS下的集群节点做健康检查
实现原理:利用VRRP协议实现。
主节点Director节点会不断的向备节点广播心跳消息。当主节点
VRRP(Virtual Router Redundancy Protocol) 虚拟路由器冗余协议,实现解决静态路由的单点故障

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值