Detailed use of Keepalived+nginx to resolve site high availability

Source: Internet
Author: User
Tags install openssl web services rsync

Background:

The company's official website PV is not high, the pressure is not big, so the company gives two servers to provide official website Web services, after all, the company façade, can not be a problem! So you need a lightweight web disaster recovery solution!

Scheme:

Using Keepalived+nginx to realize the high availability of website web

Two servers a main, one for the standby machine, so that two machines common a virtual IP, when the main server down, 106.3.32.6 this IP will automatically switch to the standby, the front-end machine after the resumption of automatic switching back to the main service machine

Then, the main server and the standby machine use rsync to realize real-time synchronization data,

The installation configuration of rsync can refer to my previous article: http://cuimk.blog.51cto.com/6649029/1322241

Environment:

CentOS 6.4

nginx-1.2.1

keepalived-1.2.2

First, installation

Both primary and secondary need to install keepalived, same installation method

Yum-y install  kernel-devel
yum install openssl-*-y wget
http://www.keepalived.org/software/ keepalived-1.2.2.tar.gz
tar xzf keepalived-1.2.2.tar.gz
cd keepalived-1.2.2
./configure--prefix=/usr/ Local/keepalived make
&& make install
ln-s/usr/src/kernels/2.6.18-238.el5-i686//usr/src/linux
cp/usr/local/keepalived/etc/rc.d/init.d/keepalived/etc/init.d/
Cp/usr/local/keepalived/etc/sysconfig /keepalived/etc/sysconfig/
mkdir-pv/etc/keepalived
cp/usr/local/keepalived/etc/keepalived/ keepalived.conf/etc/keepalived/
ln-s/usr/local/keepalived/sbin/keepalived/sbin/

Join power-on start: chkconfigkeepalived on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.