首页

在centos系统下设置同步互联网时间NTP开机启动服务(含具体操作步骤日志整理说明)

标签:ntp服务,同步时间,时间不同步     发布时间:2018-10-28   

一、前言

centos系统中“管理”-“日期和时间”设置后,无法通过网络同步日期和时间,下面通过设置NTP服务开机启动具体操作步骤进行说明解决问题。

在centos系统下设置同步互联网时间NTP开机启动服务(含具体操作步骤日志整理说明)

二、操作步骤

1. 安装ntp

[root@centos6 ivy-bin]# yum install ntp@b@已加载插件:fastestmirror, refresh-packagekit, security@b@设置安装进程@b@Determining fastest mirrors@b@ * base: ftp.sjtu.edu.cn@b@ * extras: mirrors.aliyun.com@b@ * updates: mirrors.aliyun.com@b@base                                                                                                                         | 3.7 kB     00:00     @b@extras                                                                                                                       | 3.4 kB     00:00     @b@updates                                                                                                                      | 3.4 kB     00:00     @b@解决依赖关系@b@--> 执行事务检查@b@---> Package ntp.x86_64 0:4.2.6p5-5.el6.centos will be 升级@b@---> Package ntp.x86_64 0:4.2.6p5-12.el6.centos.2 will be an update@b@--> 处理依赖关系 ntpdate = 4.2.6p5-12.el6.centos.2,它被软件包 ntp-4.2.6p5-12.el6.centos.2.x86_64 需要@b@--> 执行事务检查@b@---> Package ntpdate.x86_64 0:4.2.6p5-5.el6.centos will be 升级@b@---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.2 will be an update@b@--> 完成依赖关系计算@b@@b@依赖关系解决@b@@b@====================================================================================================================================================@b@ 软件包                          架构                           版本                                             仓库                          大小@b@====================================================================================================================================================@b@正在升级:@b@ ntp                             x86_64                         4.2.6p5-12.el6.centos.2                          base                         600 k@b@为依赖而更新:@b@ ntpdate                         x86_64                         4.2.6p5-12.el6.centos.2                          base                          79 k@b@@b@事务概要@b@====================================================================================================================================================@b@Upgrade       2 Package(s)@b@@b@总下载量:679 k@b@确定吗?[y/N]:y@b@下载软件包:@b@(1/2): ntp-4.2.6p5-12.el6.centos.2.x86_64.rpm                                                                                | 600 kB     00:00     @b@(2/2): ntpdate-4.2.6p5-12.el6.centos.2.x86_64.rpm                                                                            |  79 kB     00:00     @b@----------------------------------------------------------------------------------------------------------------------------------------------------@b@总计                                                                                                                954 kB/s | 679 kB     00:00     @b@运行 rpm_check_debug @b@执行事务测试@b@事务测试成功@b@执行事务@b@  正在升级   : ntpdate-4.2.6p5-12.el6.centos.2.x86_64                                                                                           1/4 @b@  正在升级   : ntp-4.2.6p5-12.el6.centos.2.x86_64                                                                                               2/4 @b@  清理       : ntp-4.2.6p5-5.el6.centos.x86_64                                                                                                  3/4 @b@  清理       : ntpdate-4.2.6p5-5.el6.centos.x86_64                                                                                              4/4 @b@  Verifying  : ntpdate-4.2.6p5-12.el6.centos.2.x86_64                                                                                           1/4 @b@  Verifying  : ntp-4.2.6p5-12.el6.centos.2.x86_64                                                                                               2/4 @b@  Verifying  : ntpdate-4.2.6p5-5.el6.centos.x86_64                                                                                              3/4 @b@  Verifying  : ntp-4.2.6p5-5.el6.centos.x86_64                                                                                                  4/4 @b@@b@更新完毕:@b@  ntp.x86_64 0:4.2.6p5-12.el6.centos.2                                                                                                              @b@@b@作为依赖被升级:@b@  ntpdate.x86_64 0:4.2.6p5-12.el6.centos.2                                                                                                          @b@@b@完毕!

2.  设置开机启动服务

[root@centos6 ivy-bin]# chkconfig ntpd on

3. 启动ntpd服务&查看运行状态

#或者通过service  ntpd  start启动@b@[root@centos6 ivy-bin]# /etc/init.d/ntpd start@b@正在启动 ntpd:@b@[root@centos6 ivy-bin]# chkconfig  --list  ntpd@b@ntpd            0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭@b@[root@centos6 ivy-bin]# service  ntpd  status@b@ntpd (pid  20961) 正在运行...@b@[root@centos6 ivy-bin]#
  • ◆ 相关内容