Deploy Keepalived in Ubuntu

Source: Internet
Author: User
Keepalived is a highly available solution to prevent spof. First download: cd/usrwgethttp: // response

Keepalived is a highly available solution to prevent spof.

First download:

Cd/usr

Wget http://www.keepalived.org/software/keepalived-1.2.7.tar.gz

Decompress:

Tar zxvf keepalived-1.2.7.tar.gz

Several libraries need to be installed before Compilation

  1. Apt-get install libssl-dev
  2. Apt-get install openssl
  3. Apt-get install libpopt-dev

Then run

  1. ./Configure -- prefix =/usr

The following result is displayed:

  1. Keepalived configuration
  2. ------------------------
  3. Keepalived version: 1.2.7
  4. Compiler: gcc
  5. Compiler flags:-g-O2
  6. Extra Lib:-lpopt-lssl-lcrypto
  7. Use IPVS Framework: Yes
  8. S sync daemon support: Yes
  9. S use libnl: No
  10. Use VRRP Framework: Yes
  11. Use vrrp vmac: Yes
  12. SNMP support: No
  13. Use Debug flags: No
Compile:

Make

Make install

Install the program in the following directories:

/Usr/sbin contains the executable program keepalived.

/Usr/etc/keepalived/contains the configuration file and example

/Usr/etc/rc. d/init. d/keepalived is a service script file that can be copied to the/etc/init. d directory.

Three modifications:

  1. #./Etc/rc. d/init. d/functions
  2. ./Lib/lsb/init-functions
 
  1. #./Etc/sysconfig/keepalived
  2. ./Usr/etc/sysconfig/keepalived

Because Linux except RedHat does not have the above two directories.

You must modify the following parameters and replace $ {...} with start.
  1. Start (){
  2. Echo-n $ "Starting $ prog :"
  3. # Daemon keepalived $ {KEEPALIVED_OPTIONS}
  4. Daemon keepalived start
  5. RETVAL =$?
  6. Echo
  7. [$ RETVAL-eq 0] & touch/var/lock/subsys/$ prog
  8. }
Create a directory
  1. Mkdir-p/var/lock/subsys
Now set as System Service
  1. Update-rc.d keepalived default

Install the daemon service.

Apt-get install daemon

Now, we can start it normally.

Service keepalived start

Disable

Service keepalived stop

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.