小记

一.服务器发送邮件采用轻量级的mutt+msmtp

/etc/Muttrc

……

sendmail=/usr/local/msmtp/bin/msmtp

 

mkdir /usr/local/msmtp/etc

vi /usr/local/msmtp/etc/msmtprc

account default
host smtp.163.com
port 25
fromshijingbo0108@163.com
auth login
tls off
usershijingbo0108@163.com
password XXXXXX
logfile /var/log/msmtp.log

二. lvs+keepalived相关

1. 防火墙设置

iptables -p vrrp -j ACCEPT

2. lvs相关脚本


 

#!/bin/bash
VIP=XXXXXXXXX

/etc/rc.d/init.d/functions
case “$1″ in
start)
    echo ” start tunl port”
    ifconfig lo:0 $VIP netmask 255.255.255.255 broadcast $VIP up
    echo “2”>/proc/sys/net/ipv4/conf/all/arp_announce
    echo “1”>/proc/sys/net/ipv4/conf/all/arp_ignore
    echo “2”>/proc/sys/net/ipv4/conf/lo/arp_announce
    echo “1”>/proc/sys/net/ipv4/conf/lo/arp_ignore
    ;;
stop)
    echo ” stop tunl port”
    ifconfig lo:0 down
    echo “0”>/proc/sys/net/ipv4/conf/all/arp_announce
    echo “0”>/proc/sys/net/ipv4/conf/all/arp_ignore
    echo “0”>/proc/sys/net/ipv4/conf/lo/arp_announce
    echo “0”>/proc/sys/net/ipv4/conf/lo/arp_ignore
    ;;

*)
    echo “Usage: $0 {start|stop}”
    exit 1
esac

3.相关架构

两台lvs做双主热备,各自有自己的VIP,当宕机后,VIP移到对方接管

4.