mirror of
https://github.com/samba-team/samba.git
synced 2025-08-24 21:49:29 +03:00
dont restart the tcp service after a ip takeover, it is more efficient
to just kill off the tcp connections (This used to be ctdb commit bc481c3f1a44c50648488c4f8a7f15ec395d446f)
This commit is contained in:
@ -61,12 +61,18 @@ case $cmd in
|
||||
;;
|
||||
|
||||
recovered)
|
||||
# restart NFS to ensure that all TCP connections to the released ip
|
||||
# are closed
|
||||
# RST all tcp connections used for NFS to ensure that they do
|
||||
# not survive in ESTABLISHED state across a failover/failback
|
||||
# and create an ack storm
|
||||
[ -f /etc/ctdb/state/nfs/restart ] && {
|
||||
( service nfs status > /dev/null 2>&1 &&
|
||||
service nfs restart > /dev/null 2>&1 &&
|
||||
service nfslock restart > /dev/null 2>&1 ) &
|
||||
netstat -tn |egrep '^tcp.*\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:2049\s+.*ESTABLISHED' | awk '{print $4" "$5}' | while read dest src; do
|
||||
srcip=`echo $src | cut -d: -f1`
|
||||
srcport=`echo $src | cut -d: -f2`
|
||||
destip=`echo $dest | cut -d: -f1`
|
||||
destport=`echo $dest | cut -d: -f2`
|
||||
ctdb killtcp $srcip:$srcport $destip:$destport
|
||||
ctdb killtcp $destip:$destport $srcip:$srcport
|
||||
done
|
||||
} > /dev/null 2>&1
|
||||
/bin/rm -f /etc/ctdb/state/nfs/restart
|
||||
|
||||
|
Reference in New Issue
Block a user