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
- Apt-get install libssl-dev
- Apt-get install openssl
- Apt-get install libpopt-dev
Then run
- ./Configure -- prefix =/usr
The following result is displayed:
- Keepalived configuration
- ------------------------
- Keepalived version: 1.2.7
- Compiler: gcc
- Compiler flags:-g-O2
- Extra Lib:-lpopt-lssl-lcrypto
- Use IPVS Framework: Yes
- S sync daemon support: Yes
- S use libnl: No
- Use VRRP Framework: Yes
- Use vrrp vmac: Yes
- SNMP support: No
- 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:
- #./Etc/rc. d/init. d/functions
- ./Lib/lsb/init-functions
- #./Etc/sysconfig/keepalived
- ./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.
- Start (){
- Echo-n $ "Starting $ prog :"
- # Daemon keepalived $ {KEEPALIVED_OPTIONS}
- Daemon keepalived start
- RETVAL =$?
- Echo
- [$ RETVAL-eq 0] & touch/var/lock/subsys/$ prog
- }
Create a directory
- Mkdir-p/var/lock/subsys
Now set as System Service
- 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