在Nginx容器安装Keepalived后端项目双机热备

Posted shanheyongmu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Nginx容器安装Keepalived后端项目双机热备相关的知识,希望对你有一定的参考价值。

docker exec -it n1 bash
apt-get update
apt-get install keepalived 

apt-get install vim


        再次之前要配置VIP虚拟IP   docker network create --subnet=192.168.99.151/16 net1
        docker network ls
                                 这里还要设置下vim 无法粘贴问题

vi /etc/keepalived/keepalived.conf
启动keepalived
service keepalived start





docker run -it -d --name n2 -v /home/n2/nginx.conf:/etc/nginx/nginx.conf --net=host --privileged nginx
重复上面步骤 

 

以上是关于在Nginx容器安装Keepalived后端项目双机热备的主要内容,如果未能解决你的问题,请参考以下文章

【keepalived】keepalived vrrp 双实例

Nginx+Keepalived 主备高可用 安装与配置

Keepalived+Nginx双机主备配置实践

Ansible 一键配置安装Keepalived+Nginx作为前端,httpd+php作为后端

Nginx+keepalived双主配置(双机双主热备)

负载均衡haproxy+keepalivedlvs+keepalived后端php+nginx框架