RH124-10 时间同步NTP

[[email protected] Desktop]$ timedatectl

Local time: Sat 2017-06-03 21:58:12 CST

Universal time: Sat 2017-06-03 13:58:12 UTC

Timezone: Asia/Shanghai (CST, +0800)

NTP enabled: yes

NTP synchronized: no

RTC in local TZ: no

DST active: n/a

[[email protected] Desktop]$

对时间设定需要root

远程到server0

[[email protected] ~]# timedatectl list-timezones  查看支持的时区

Africa/Abidjan

Africa/Accra

Africa/Addis_Ababa

Africa/Algiers

[[email protected] ~]# timedatectl set-timezone "America/New_York"

[[email protected] ~]# timedatectl

Local time: Sat 2017-06-03 10:09:02 EDT

Universal time: Sat 2017-06-03 14:09:02 UTC

RTC time: Sat 2017-06-03 22:09:02

Timezone: America/New_York (EDT, -0400)

NTP enabled: yes

NTP synchronized: no

RTC in local TZ: no

DST active: yes

Last DST change: DST began at

Sun 2017-03-12 01:59:59 EST

Sun 2017-03-12 03:00:00 EDT

Next DST change: DST ends (the clock jumps one hour backwards) at

Sun 2017-11-05 01:59:59 EDT

Sun 2017-11-05 01:00:00 EST

[[email protected] ~]#

[[email protected] ~]# timedatectl set-time 22:25:00  设置 时间

[[email protected] ~]# timedatectl set-ntp true

[[email protected] ~]# timedatectl

Local time: Sat 2017-06-03 22:27:06 EDT

Universal time: Sun 2017-06-04 02:27:06 UTC

RTC time: Sun 2017-06-04 02:27:07

Timezone: America/New_York (EDT, -0400)

NTP enabled: yes

NTP synchronized: no

RTC in local TZ: no

DST active: yes

Last DST change: DST began at

Sun 2017-03-12 01:59:59 EST

Sun 2017-03-12 03:00:00 EDT

Next DST change: DST ends (the clock jumps one hour backwards) at

Sun 2017-11-05 01:59:59 EDT

Sun 2017-11-05 01:00:00 EST

[[email protected] ~]# vim /etc/chrony.conf

写入

server content.example.com iburst 目的是  让系统知道从哪里同步NTP时间

[[email protected] ~]# systemctl enable chronyd

[[email protected] ~]# systemctl restart chronyd

[[email protected] ~]#

大约需要五分钟才可以同步

检验:

[[email protected] ~]# timedatectl     命令1

Local time: Sat 2017-06-03 10:22:59 EDT

Universal time: Sat 2017-06-03 14:22:59 UTC

RTC time: Sat 2017-06-03 14:22:59

Timezone: America/New_York (EDT, -0400)

NTP enabled: yes   看这里

NTP synchronized: yes   看这里

RTC in local TZ: no

DST active: yes

Last DST change: DST began at

Sun 2017-03-12 01:59:59 EST

Sun 2017-03-12 03:00:00 EDT

Next DST change: DST ends (the clock jumps one hour backwards) at

Sun 2017-11-05 01:59:59 EDT

Sun 2017-11-05 01:00:00 EST

[[email protected] ~]# chronyc sources -v   命令2

210 Number of sources = 1

.-- Source mode  ‘^‘ = server, ‘=‘ = peer, ‘#‘ = local clock.

/ .- Source state ‘*‘ = current synced, ‘+‘ = combined , ‘-‘ = not combined,

| /   ‘?‘ = unreachable, ‘x‘ = time may be in error, ‘~‘ = time too variable.

||                                                 .- xxxx [ yyyy ] +/- zzzz

||                                                /   xxxx = adjusted offset,

||         Log2(Polling interval) -.             |    yyyy = measured offset,

||                                  \            |    zzzz = estimated error.

||                                   |           |

MS Name/IP address         Stratum Poll Reach LastRx Last sample

===============================================================================

^* classroom.example.com         8   6    37    28   +230ns[ +164us] +/- 1082us

[[email protected] ~]# chro

chronyc  chronyd  chroot

[[email protected] ~]# chronyc   命令3

chrony version 1.29.1

Copyright (C) 1997-2003, 2007, 2009-2013 Richard P. Curnow and others

chrony comes with ABSOLUTELY NO WARRANTY.  This is free software, and

you are welcome to redistribute it under certain conditions.  See the

GNU General Public License version 2 for details.

chronyc> waitsync   命令4

try: 1, refid: 172.25.254.254, correction: 0.000006130, skew: 1.482

chronyc>

时间: 2024-08-02 23:22:12

RH124-10 时间同步NTP的相关文章

Ubuntu配置OpenStack 二:配置时间同步NTP和安装数据库Maridb以及问题总结

继上一节Ubuntu配置OpenStack 一:配置主机环境,下面继续为安装时间同步,以及配置openstack的安装包源和安装数据库Maridb.(全文截图都是由自己徒手搭建完成并且截图) 第一节连接配置主机环境  http://www.cnblogs.com/skylarzhan/p/7702078.html 一.安装时间同步NTP NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机保持时间同步的一种协议,NTP客户端可以和NTP服务器的计算机时间保

Windows server2012时间同步NTP配置

Windows server2012时间同步NTP配置 遇到经常服务器时间无法同步,可以自己建立一台时间同步服务器,NTP配置如下: 一.服务端配置 (Ntp服务器,客户端将根据这台服务器的时间进行同步) 1.  微软键+R键,进入"运行",输入"regedit",进入注册表 2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type 右键修->修改 为 NTP

为嵌入式开发板客户端自己动手在虚拟机上搭建时间同步NTP服务器

网络时间协议NTP(Network Time Protocol)是用于互联网中时间同步的标准互联网协议.NTP的用途是把计算机的时间同步到某些时间标准.目前采用的时间标准是世界协调时 UTC(Universal Time Coordinated).NTP的主要开发者是美国特拉华大学的David L. Mills教授.NTP对于我们个人来说有什么用呢,简单的讲,当你的计算机时间不准确了,你可以接入到互联网,从网上同步一下时间,看多方便. 对于企业来说,当你有成百上千的计算机,都不能直接连接互联网,

时间同步ntp服务的安装与配置

通过ntp服务实现时间同步. 1:首先搭建本地yum源见网址(http://www.cnblogs.com/zj21/p/6223462.html) 2:先安装ntp服务 [[email protected] ~]# yum install ntp -y 3:修改ntp的配置文件 [[email protected] ~]# vi /etc/ntp.conf # For more information about this file, see the man pages# ntp.conf(5

时间同步ntp服务的安装与配置(作为客户端的配置

在linux环境下,我们不仅可以自己设置时间,也可以对系统进行时间的同步,比如同步时间到某台物理机上或虚拟机,皆可!接下来我们就以同步时间到某台物理机为例, 一起学习学习. 1.配置本地yum源(挂载光盘) mkdir /xia //创建目录 mount /dev/cdrom /xia //挂载到/xia目录 2.修改yum配置文件  (目的是注释掉多余的文件,只剩一个文件以便修改配置) mv +文件名+ 修改后的文件名 //文件名的更改 3. 修改挂载路径/xia,然后将gpgcheck=1改

linux时间同步ntp服务的安装与配置

通过ntp服务实现时间同步. 1:首先搭建本地yum源见网址(http://www.cnblogs.com/zxbdbk/p/6020679.html) 2:先安装ntp服务 [[email protected] ~]# yum install ntp -y 3:修改ntp的配置文件 [[email protected] ~]# vi /etc/ntp.conf # For more information about this file, see the man pages# ntp.conf

设置WindowServer2012 时间同步NTP

在powershell中以管理员身份运行以下命令即可 w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL Stop-Service w32time Start-Service w32time   W32tm is the command to use. Sure, there are articles out there mentioning "net time", but you should not us

linux 时间同步ntp

配置前准备:关闭防火墙,配置好hosts,ssh免密登录 1.选定同步的标准,我是以hadoop002(设置为当前时间)作为同步标准,hadoop003(时间是2018年3月21,使用date -s进行设置)与hadoop004(2018年3月21)与之保持同步 在hadoop002上查看是否安装ntp rpm -qa|grep ntp,如果没有显示内容说明没有安装ntp,执行yum install ntp -y安装即可 接下来修改/etc/ntp.conf 增加 1 server 127.12

RHEL 7.6 设置时间同步ntp

1.服务端和客户端 安装包,检查状态 yum install ntp ntpdate -y systemctl start ntpd systemctl status ntpd 2.服务端 修改配置 vi /etc/ntp.conf #server 0.rhel.pool.ntp.org iburst #server 1.rhel.pool.ntp.org iburst #server 2.rhel.pool.ntp.org iburst #server 3.rhel.pool.ntp.org