# set a safe path before doing anything else
PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
# This script must be executed as root
RUID=`/usr/bin/id|awk -F\( {print $1}|awk -F\= {print $2}`
if [ ${RUID} != "0" ] ; then
echo "This script must be executed as root"
exit 1
fi
# Display an error and exit
errorExit() {
echo "$@" >&2
exit 1
}
# Display the normal print
displayheader() {
echo -e "\033[32m**********************************************************\033[0m"
echo -e "\033[32m*\033[0m"$@""
echo -e "\033[32m**********************************************************\033[0m"
echo ""
}
prepareSystem(){
# Set SElinux to disabled mode regardless of its initial value
sed -i -e s/^SELINUX=.*/SELINUX=disabled/ /etc/selinux/config
setenforce 0
# stop iptables
/etc/init.d/iptables stop > /dev/null 2>&1
# *** Chkconfig section
# Turn off unwanted services
chkconfig --level 0123456 iptables off
chkconfig --level 0123456 ip6tables off
}
#Configure the kernel params
Configure1(){
cat >> /etc/sysctl.conf <<EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
if [ $? != 0 ]; then
errorExit Unable to configure sysctl settings for database
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-62078-8.html
我是南昌在校大学生
有台人回到家乡这么说