Keepalved hot standby

Source: Internet
Author: User

I,Keepalived installation and Service Control (installed on the master server and backup server)
1) install the supporting software
Before compilation, you must install the kernel development kit kernel-devel openssl-devel popt-devel kernel SADM.
[Root @ localhost ~] # Yum-y install kernel-devel openssl-devel popt-devel
[Root @ localhost ~] # Rpm-ivh/misc/cd/Server/Packages/ipvsadm-1.25-9.e16.i686.rpm
2) Compile and install keepalived
[Root @ localhost ~] # Tar zxf keepalived-1.2.2.tar.gz
[Root @ localhost ~] # Cd keepalived-1.2.2
[Root @ localhost ~] #./Configure -- prefix =/-- with-kernel-dir =/usr/src/kernels/2.6.32-131
. 0.15.e16.i686
[Root @ localhost ~] # Make & make install
3) use the keepalived Service
[Root @ localhost ~] # Ls-l/etc/init. d/keepalived
-Rwxr-xr-x 1 root 1288 November 8 16.23/etc/init. d/keepalived
[Root @ localhost ~] # Chkconfig -- add keepalived
[Root @ localhost ~] # Chkconfig keepalived on

Ii. Use keepalived for hot standby

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05223T293-0.jpg "title =" 853.jpg" alt = "175456756.jpg"/>

1) master server configuration
[Root @ localhost ~] # Cd/etc/keepalived/
[Root @ localhost ~] # Cp keepalived. conf keepalived. conf. bak
[Root @ localhost ~] # Vim keepalived. conf
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05223W138-1.jpg "title =" 28.jpg" alt = "175551770.jpg"/>


[Root @ localhost ~] # Service keepalived start
[Root @ localhost ~] # Ip addr show dev eth0 // view floating address
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05223S010-2.jpg "title =" 8.jpg" alt = "175620.6.jpg"/>

2) Backup Server Configuration

Note: vrorouname route_ip): We recommend that you specify different names for each server involved in hot backup.

Hot Standby state): there should be at least one MASTER server, set the state to MASTER; there can be multiple slave

Server, set the status to BACKUP

Priority): a greater value indicates a higher priority for obtaining control over the VIP.

The level should be set to the highest;

# When configuring the backup server, you only need to modify the vro name, hot standby status, and priority.

[Root @ localhost ~] # Cd/etc/keepalived/

[Root @ localhost ~] # Cp keepalived. conf keepalived. conf. bak
[Root @ localhost ~] # Vim keepalived. conf

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05223S923-3.jpg "title =" 1.jpg" alt = "175710542.jpg"/>

[Root @ localhost ~] # Service keepalived start
[Root @ localhost ~] # Ip addr show dev eth0 // the backup server cannot see the floating address,


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.