NTP

——NTP协议

NTPv3:RFC1305

NTPv4:RFC5905

——时区

(1)timedatectl set-timezone

  • China Standard Time (CST), UTC +8

timedatectl set-timezone 'Asia/Shanghai'

timedatectl set-timezone CST

  • Coordinated Universal Time (UTC), UTC +0

timedatectl set-timezone UTC

(2)docker时区

a.docker cp /etc/localtime ${CONTAINER_NAME}:/etc

b.docker run -v /etc/localtime:/etc/localtime --restart=always --device /dev/uio0 -i --privileged --name=${CONTAINER_NAME} --network=host centos:7 /usr/sbin/init & > /dev/null 2>&1

——配置

#drifffile /var/lib/ntp/drift
#statsdir /var/log/ntp
#logfile /var/log/ntp/ntp.log
#
#restrict 127.0.0.1
#restrict -6::1
#
#server 127.127.1.0 perfer version 3
#fudge 127.127.1.0 stratum 10
#
#includefile /etc/ntp/crypto/pw
#keys /etc/ntp/keys
#disable monitor

——常用命令

Windows下:net start/stop w32time

注:在windows下配置NTP都会涉及注册表的修改,各种参数的设置参考windows官方文档

linux下:

#ntpq -np

#ntpstat

#systemctl start/status/restart/stop ntpd.service  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值