Created
August 6, 2020 07:37
-
-
Save sljeff/802c68cabeadbbda1c5a4a413b65668c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
install_ipset() { | |
yum install -y ipset ipvsadm | |
} | |
load_mod() { | |
echo "#!/bin/bash | |
modprobe -- ip_vs | |
modprobe -- ip_vs_rr | |
modprobe -- ip_vs_wrr | |
modprobe -- ip_vs_sh | |
modprobe -- nf_conntrack_ipv4 | |
ipvsadm --set 7300 120 300" > /etc/sysconfig/modules/ipvs.modules | |
chmod 755 /etc/sysconfig/modules/ipvs.modules | |
} | |
update_hash_table_size() { | |
echo "options ip_vs conn_tab_bits=20" > /etc/modprobe.d/ip_vs.conf | |
shutdown -r now | |
} | |
install_ipset | |
load_mod | |
update_hash_table_size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment