|
|
|
@ -231,31 +231,7 @@ installZookeeper(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
installNTP(){
|
|
|
|
|
echo "************[installing NTP]正在安装NTP >>>>>>>>>>>>>"
|
|
|
|
|
echo ""
|
|
|
|
|
if [ ! `rpm -qa | grep ntp- | wc -l` -ne 0 ]; then
|
|
|
|
|
rpm -ivh package/ntp-4.2.6p5-29.el7.centos.2.x86_64.rpm
|
|
|
|
|
sleep 1
|
|
|
|
|
fi
|
|
|
|
|
sed -i 's/^[^#]*server 0.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 1.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 2.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 3.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
|
|
|
|
|
if [ `grep --color=auto -c "server 127.127.1.0" /etc/ntp.conf` = '0' ]; then
|
|
|
|
|
sed -i '/server 3.centos.pool.ntp.org iburst/a\\nserver 127.127.1.0' /etc/ntp.conf
|
|
|
|
|
sed -i '/server 127.127.1.0/a fudge 127.127.1.0 stratum' /etc/ntp.conf
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
systemctl restart ntpd
|
|
|
|
|
sleep 1
|
|
|
|
|
echo " 重启NTP ..."
|
|
|
|
|
echo ""
|
|
|
|
|
systemctl disable chronyd
|
|
|
|
|
systemctl enable ntpd
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -369,10 +345,6 @@ if [ $NGINX_INS == 1 ]; then
|
|
|
|
|
setAutoStartNginx
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ $NTP_INS == 1 ]; then
|
|
|
|
|
installNTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
updateFirewall
|
|
|
|
|
|
|
|
|
|
echo "************[install finished.]安装完成. >>>>>>>>>>>>>"
|
|
|
|
|