当前位置:网站首页 > 编程语言 > 正文

ntsd命令(ntp 命令)



服务器对时间要求非常严格,linux服务器文件的生成,日志,以及数据库的连接都是根据时间的逻辑

进行任务处理,如果时间不同步,那么,处理的任务,以及出问题的分析日志,时间不对,很难分析

直接更改linux服务器时间,影响特别大,大家都知道,服务器群启动是有规律的,如果随便更改linux服务器时间

很有可能造成时间逻辑大站,造成其它模块报警,以及数据库报警等,所以建服务器之前,先配置ntp服务器,

部分服务器为了安全不能上网,所以不能同步网络时间,所以我们让它同步我局域网的ntp服务器,以下是设置相关命令

客户端设置同步ntp服务器命令如下

备注:国内最常见的NTP服务器:

210.72.145.44 (国家授时中心服务器IP地址)
133.100.11.8 日本 福冈大学
time-a.nist.gov 129.6.15.28 NIST, Gaithersburg, Maryland
time-b.nist.gov 129.6.15.29 NIST, Gaithersburg, Maryland
time-a.timefreq.bldrdoc.gov 132.163.4.101 NIST, Boulder, Colorado
time-b.timefreq.bldrdoc.gov 132.163.4.102 NIST, Boulder, Colorado
time-c.timefreq.bldrdoc.gov 132.163.4.103 NIST, Boulder, Colorado
utcnist.colorado.edu 128.138.140.44 University of Colorado, Boulder
time.nist.gov 192.43.244.18 NCAR, Boulder, Colorado
time-nw.nist.gov 131.107.1.10 Microsoft, Redmond, Washington
nist1.symmetricom.com 69.25.96.13 Symmetricom, San Jose, California
nist1-dc.glassey.com 216.200.93.8 Abovenet, Virginia
nist1-ny.glassey.com 208.184.49.9 Abovenet, New York City
nist1-sj.glassey.com 207.126.98.204 Abovenet, San Jose, California
nist1.aol-ca.truetime.com 207.200.81.113 TrueTime, AOL facility, Sunnyvale, California
nist1.aol-va.truetime.com 64.236.96.53 TrueTime, AOL facility, Virginia
————————————————————————————————————
ntp.sjtu.edu.cn 202.120.2.101 (上海交通大学网络中心NTP服务器地址)
s1a.time.edu.cn 北京邮电大学
s1b.time.edu.cn 清华大学
s1c.time.edu.cn 北京大学
s1d.time.edu.cn 东南大学
s1e.time.edu.cn 清华大学
s2a.time.edu.cn 清华大学
s2b.time.edu.cn 清华大学
s2c.time.edu.cn 北京邮电大学
s2d.time.edu.cn 西南地区网络中心
s2e.time.edu.cn 西北地区网络中心
s2f.time.edu.cn 东北地区网络中心
s2g.time.edu.cn 华东南地区网络中心
s2h.time.edu.cn 四川大学网络管理中心
s2j.time.edu.cn 大连理工大学网络中心
s2k.time.edu.cn CERNET桂林主节点
s2m.time.edu.cn 北京大学
—————————————————————

[root@desk ~]# vim /etc/ntp.conf

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #设置哪些网段可以使用这台ntp服务器

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 202.120.2.101
server s2f.time.edu.cn
server s2g.time.edu.cn
server s2k.time.edu.cn
server s2m.time.edu.cn

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

到此这篇ntsd命令(ntp 命令)的文章就介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • 十大最强法则排名(十大最强法则排名榜)2025-04-02 08:27:05
  • 如何用网页传输文件(如何用网页传输文件到手机)2025-04-02 08:27:05
  • tii审稿周期(审稿周期长一般不会退稿)2025-04-02 08:27:05
  • td 缩写(td缩写的含义)2025-04-02 08:27:05
  • pillows是什么意思(pillow shams什么意思)2025-04-02 08:27:05
  • 跨域是什么 怎么解决(跨域是什么,如何解决跨域)2025-04-02 08:27:05
  • dateutils 工具类如何获取年月日(new date() 获取年月日)2025-04-02 08:27:05
  • 赛博朋克2077战斗系统太烂(赛博朋克2077战斗系统太烂了怎么办)2025-04-02 08:27:05
  • wifi字典破解在线(wifi破解 字典)2025-04-02 08:27:05
  • 本机机信息(显示本机信息)2025-04-02 08:27:05
  • 全屏图片