CentOS7如何修改系统时间?OpenVZ同步时区到NTP服务器
source link: https://www.chenweiliang.com/cwl-1307.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CentOS7如何修改系统时间?OpenVZ同步时区到NTP服务器
2021年2月4日
最简单的方法,是通过SSH命令,快速配置OpenVZ同步时区到NTP服务器。
- NTP英文全称是Network Time Protocol(网络时间协议)。
OpenVZ是什么?
- OpenVZ是基于Linux内核的操作系统级虚拟化技术。
- OpenVZ允许物理服务器运行多个操作系统,该技术常用于虚拟专用服务器。
首先,删除本地时区 ▼
rm -rf /etc/localtime
修改时区到+8区 ▼
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
查看时区设置 ▼
date -R
如何修改CentOS 7系统时间?
接下来修改CentOS 7系统时间,设定OpenVZ同步时区到NTP服务器与时间服务器同步。
安装NTP ▼
yum install -y ntp
调试查看时间差异 ▼
ntpdate -d us.pool.ntp.org
同步时间 ▼
ntpdate us.pool.ntp.org
检查时间是否同步 ▼
date -R
修改 NTP 的配置文件 ▼
vi /etc/sysconfig/ntpd
同步独立主机的硬件时钟 ▼
SYNC_HWCLOCK=yes
配置开机启动 NTP 服务,定期自动同步时间 ▼
systemctl enable ntpd.service
启动 NTP 同步 ▼
systemctl enable ntpd.service
希望陈沩亮博客( https://www.chenweiliang.com/) 分享的《CentOS7如何修改系统时间?OpenVZ同步时区到NTP服务器》,对您有帮助。
欢迎分享本文链接:https://www.chenweiliang.com/cwl-1307.html
最近陈沩亮博客刚开通了Telegram频道,而且已经将陈沩亮博客和Telegram频道实现了自动同步。
下次最新分享会第一时间自动同步到Telegram频道,欢迎订阅 ^_^
您的分享和按赞,是我们持续的动力!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK