同步時間
# 安裝軟件
centos7: yum -y install ntpdate
centos8: yum install -y chrony
# 向阿里云服務(wù)器同步時間
centos7: ntpdate time1.aliyun.com
centos8: chronyd -q 'server ntp.ntsc.ac.cn iburst'
# 刪除本地時間并設(shè)置時區(qū)為上海
centos7:
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
centos8:
vim /etc/chrony.conf
注釋掉第三行原有的時間服務(wù)器地址玷禽,設(shè)置為阿里云的時間服務(wù)地址
阿里云提供了7個NTP時間服務(wù)器也就是Internet時間同步服務(wù)器地址
ntp1.aliyun.com
#重啟時間服務(wù)
systemctl restart chronyd.service
#設(shè)置時間同步服務(wù)開機啟動
systemctl enable chronyd.service
# 查看時間
date -R || date
命令補全
# 安裝bash-completion
yum -y install bash-completion bash-completion-extras
# 使用bash-completion
source /etc/profile.d/bash_completion.sh
關(guān)閉swap分區(qū)
# 臨時關(guān)閉:
swapoff -a
#永久關(guān)閉:
vi /etc/fstab
# 將文件中的/dev/mapper/centos-swap這行代碼注釋掉
#/dev/mapper/centos-swap swap swap defaults 0 0
# 確認swap已經(jīng)關(guān)閉:若swap行都顯示 0 則表示關(guān)閉成功
free -m
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者