通过NTP服务器实现时间同步
1、安装ntp,yum install ntp

2、Date 发现格式为EDT,我们需要修改为CST格式

3、[root@test ~]# mv /etc/localtime /etc/localtime.bak
[root@test ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@test ~]# date

4、并用ntpdate 208.91.112.50,同步网上的一台ntp服务器同步时间

5、vi/etc/ntp.conf,修改配置文件,使能同步网上的ntp服务器

6、我们这里使用的是centos7不同于以往linux的操作,对于开机自启动的调整,命令有所不同。 chkconfig --list查看非系统内置服务的自启动状态
systemctl enable ntpd.service //开机自启动

7、ntpq –p
*表示目前使用的ntp server的状态

8、Ntpstat,可以看到已经同步了

9、显示所有已启动的服务 systemctl list-units --type=service

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:137
阅读量:135
阅读量:88
阅读量:53
阅读量:20