Keepalived高可用集群应用场景与配置(3)

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include      mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    upstream bbs_server_pools {  # bbs业务服务器池
        server 10.0.0.101:80 weight=1;
        server 10.0.0.102:80 weight=1;
        # 假设10.0.0.101和10.0.0.102为bbs业务的两个集群节点
    }
    upstream blog_server_pools {  # blog业务服务器池
        server 10.0.0.103:80 weight=1;
        server 10.0.0.104:80 weight=1;
        # 假设10.0.0.103和10.0.0.104为bbs业务的两个集群节点
    }
    server {
        listen 10.0.0.12:80;
        server_name bbs.linuxidc.com;
        location / {
        proxy_pass ;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        }
    }
    server {
        listen 10.0.0.13:80;
        server_name blog.linuxidc.com;
        location / {
        proxy_pass ;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        }
    }
}

可以看到,两台负载均衡器的Nginx配置是一样的。

CentOS 7下Keepalived + HAProxy 搭建配置详解 

《Keepalived权威指南》下载见

Nginx+Keepalived实现站点高可用 

Nginx+Keepalived实现站点高可用(负载均衡) 

构建高可用集群Keepalived+Haproxy负载均衡

CentOS6.5下 Keepalived高可用服务单实例配置

Keepalived安装与配置

Linux下Keepalived服务安装文档 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/af4d9bcf9df96f71718d98edd2d12391.html