search

Home  >  Q&A  >  body text

nginx - Questions about server load balancing and high availability

Please answer some questions about server high availability!

  1. For example, ngnix is ​​used as an intermediate server and the reverse proxy web server (tomcat) is used for load balancing. Is this considered high availability?

  2. Then I was afraid that ngnix would hang up and I used lvs keepalived as middleware to achieve high availability, but I think lvs might also hang up. Is it necessary to do this? Or is there a corresponding node switching solution if LVS is down?

漂亮男人漂亮男人2781 days ago1142

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-06-29 10:11:13

    Combined with keepalived to make nginx highly available. The specific performance is as follows: if one nginx is found to be down, the second nginx will be started immediately to take over.
    The general outline is as follows:
    Two nginx units are bound to the same IP. Among the two units, only one is always in use. Between the two units, ka is used for detection. If the main unit is down, the slave Take over immediately to achieve high availability of nginx load balancing.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-06-29 10:11:13

    1. This is considered high availability. The performance can be scaled horizontally, and even if some parts fail, the business will not be interrupted.

    2. The architecture of the first four layers of load balancing (LVS) + seven layers of load balancing (nginx) + business (tomcat, php, etc.) is very common. Each layer can use multiple units for high availability, or some can be removed. The specific implementation depends on your business needs.


    1. Hardware failure is to use multiple machines to provide high availability to resist this risk.

    2. The computer room is powered off and has dual mains + UPS + generator. If the computer room is not up to standard, then replace the computer room.

    3. If the switch is down, it can be stacked.

    4. If the network fails, you can use multiple optical fiber access and bare fiber dedicated lines.


    1. If your requirements are very high, you can do dual live-active in different places, three centers in two places, and you are not afraid of earthquakes and tsunamis.


    There are many solutions, but there is only one problem - money.

    reply
    0
  • Cancelreply