Linux 系统优化
1、网卡绑定
systemctl stop NetworkManager
systemctl disable NetworkManager
# modprobe --first-time bonding
# lsmod |grep bonding
# cat <<EOF> /etc/sysconfig/network-scripts/ifcfg-bond0
# DEVICE=bond0
# TYPE=Bond
# IPADDR=
# NETMASK=
# GATEWAY=
# USERCTL=no
# BOOTPROTO=none
# ONBOOT=yes
# BONDING_MASTER=yes
# EOF
# cat <<EOF> /etc/modprobe.d/bond.conf
# alias bond0 bonding
# options bond0 million=100 mode=0
# EOF
# if [[ `ifconfig|wc -l` > 1 ]];then
# ENS2=`ifconfig |grep ens|grep -v 'ens33'|awk -F: '{print $1}'`
# if [ -f /etc/sysconfig/network-scripts/ifcfg-$ENS2 ];then
# echo "is $ENS2"
# ## 双网卡文件
# ENS=`ifconfig |grep ens|awk -F: '{print $1}'`
# for i in $ENS
# do
# sed -i "s/DEVICE.*/DEVICE=$ENS2/g" /etc/sysconfig/net