ntpdate

ntpdate更新系统时间时报错Can't find host ntp1.aliyun.com: Servname not supported for ai_socktype (-8)

a 夏天 提交于 2019-12-04 17:57:59
ntpdate更新系统时间时报错Can't find host ntp1.aliyun.com: Servname not supported for ai_socktype (-8) 所报错误: [root@web01 ~]# ntpdate ntp1.aliyun.com Error resolving ntp1.aliyun.com: Servname not supported for ai_socktype (-8) 11 Feb 20:58:03 ntpdate[3318]: Can't find host ntp1.aliyun.com: Servname not supported for ai_socktype (-8) 11 Feb 20:58:03 ntpdate[3318]: no servers can be used, exiting 原因:/etc/services 文件被改动或者不存在 导致域名解析错误 [root@web01 etc]# ls -l servic* -rw-r--r--. 1 root root 10240 Feb 11 02:27 services -rw-r--r-- 1 root root 641020 Feb 11 02:22 services.bak 长格式对比后发现源文件已改动 [root@web01 etc]# mv

7

醉酒当歌 提交于 2019-12-04 09:46:09
Linux-day07 定时任务 crond 系统级别 :定时文件清理,日志切割,定时收集系统的状态 用户级别 :同步系统时间,定时备份数据 定时任务相关的文件 [root@qls ~]# [root@qls ~]# ll /etc/cron* -d drwxr-xr-x. 2 root root 21 Aug 14 15:11 /etc/cron.d drwxr-xr-x. 2 root root 42 Aug 14 15:12 /etc/cron.daily #系统每天执行定时任务 -rw-------. 1 root root 0 Apr 11 2018 /etc/cron.deny #黑名单 drwxr-xr-x. 2 root root 22 Aug 14 15:11 /etc/cron.hourly #系统每小时 drwxr-xr-x. 2 root root 6 Jun 10 2014 /etc/cron.monthly #系统每个月 -rw-r--r--. 1 root root 451 Jun 10 2014 /etc/crontab #定时任务的主配置文件 drwxr-xr-x. 2 root root 6 Jun 10 2014 /etc/cron.weekly #系统每周 /var/spool/cron/ #用户定时任务存放地址 [root@qls ~]#

Linux配置ntp时间服务器(全)

…衆ロ難τιáo~ 提交于 2019-12-03 23:51:50
时间服务器作用: 大数据产生与处理系统是各种计算设备集群的,计算设备将统一、同步的标准时间用于记录各种事件发生时序, 如E-MAIL信息、文件创建和访问时间、数据库处理时间等。 大数据系统内不同计算设备之间控制、计算、处理、应用等数据或操作都具有时序性, 若计算机时间不同步,这些应用或操作或将无法正常进行。 大数据系统是对时间敏感的计算处理系统,时间同步是大数据能够得到正确处理的基础保障,是大数据得以发挥作用的技术支撑。 大数据时代,整个处理计算系统内的大数据通信都是通过网络进行。 时间同步也是如此,利用大数据的互联网络传送标准时间信息,实现大数据系统内时间同步。 网络时间同步协议(NTP)是时间同步的技术基础。 (一)确认ntp的安装 1)确认是否已安装ntp 【命令】rpm –qa | grep ntp 若只有ntpdate而未见ntp,则需删除原有ntpdate。如: ntpdate-4.2.6p5-22.el7_0.x86_64 fontpackages-filesystem-1.44-8.el7.noarch python-ntplib-0.3.2-1.el7.noarch 2)删除已安装ntp 【命令】yum –y remove ntpdate-4.2.6p5-22.el7.x86_64 3)重新安装ntp 【命令】yum –y install ntp (二

NTP服务器知识整理

怎甘沉沦 提交于 2019-12-03 07:51:19
1. 什么是GMT (格林威治) 时间与UTC 时间? GMT时间是以太阳通过格林威治的那一刻来作为计时的标准,地球共有24 个时区,而以格林威治时间(GMT) 为标准时间,台湾本地时间为GMT + 8 小时。不准确,但是方便记忆与理解。 UTC时间是使用『原子震荡周期』所计算的物理时钟。最准确。 两个时间计时的方式不同,GMT与UTC时间有差不多16分钟的误差! 2. 现在,你将有一个月的时间要出差到美国的纽约去,时间会不一致啊!你该如何手动的调整时间参数呢? 因为时区资料档在/usr/share/zoneinfo 内,在该目录内会找到/usr/share/zoneinfo/America/New_York 这个时区档。而时区设定档在/etc/sysconfig/clock ,且目前的时间格式在/etc/localtime ,所以你应该这样做: [root@www ~]# date Thu Jul 28 15:08:39 CST 2011 <==重点是CST这个时区喔! [root@www ~]# vim /etc/sysconfig/clock ZONE=" America/New_York " <==改的是这里啦! [root@www ~]# cp /usr/share/zoneinfo/America/New_York /etc/localtime [root@www ~]

FreeBSD设置开机同步时间

和自甴很熟 提交于 2019-12-03 05:57:39
没有设置开机同步时间的话,重启之后时间不对。 如果装机时没正确设置时区,先设置时区: # tzsetup 用date命令手工设置时间一方面不方便,另一方面也依赖于本地管理员的时钟的正确性,那么网络上不同的管理员管理的计算机时间必然有偏差,不同计算机的时间偏差就会对一些要求时间同步的服务产生影响。解决这种问题的方法很简单,连接到一个能提供精确时间的服务器上进行时间同步。 当计算机连接到了Internet之后,那么就能同Internet上存在的很多时间服务器通信,以获得精确的时间。TCP/IP协议中,用于同步时间的协议为ntp协议,在Internet上提供ntp服务的站点有clepsydra.dec.com 、 ben.cs.wisc.edu、truechimer.waikato.ac.nz 等,虽然ntp协议本身考虑了网络延迟,然而网络延迟毕竟会对时间的精确性造成影响,因此应该选用一个离本地计算机最近的时间服务器。   使用/stand/sysinstall也能设定时间同步,可以根据地域来选择合适的时间服务器,然而由于网络连接并不一定和地域相一致,因此不能完全根据地域的远近来选择时间服务器。   使用ntp协议更新自己计算机上的时间的一个简单的应用程序为ntpdate,同样这也需要使用root权限执行: # ntpdate clepsydra.dec.com

ntpdate command not found ? MacOS MOJAVE

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello I have a bash script who update the time of my mac but since the update of Majove the command isn't found: ntpdate -u time.apple.com return : ntpdate: command not found Where I going wrong ? Thanks to your reply 回答1: It's a duplicate. Please check this stackoverflow question . TL;DR use sudo sntp -sS time.apple.com instead. 回答2: For anyone trying to do this because their vm cannot connect to the update server while trying to install macos on a virtual machine, I switched my network adapter from NAT to bridged and the issue was resolved

NTP服务器时间同步

匿名 (未验证) 提交于 2019-12-03 00:41:02
一、简要说明 二、安装步骤 三、配置文件 四、常用命令 五、注意事项 六、运行截图 七、参考资料 一、简要说明 ????????? 搭建Kubernetes环境,需要几台、几十台机器配合运作,许多集群服务比如Etcd等都依赖系统的时间,如果机器的系统时间不一致,可能会出现各种问题。因此有必要统一集群内所有服务器的系统时间。 ????????? NTP(Network Time Protocol)可以很方便的解决服务器之间的时间同步问题,Ubuntu系统下NTP安装也很方便,经过测试,在Ubuntu 16.04环境下,直接安装NTP服务,使用Ubuntu系统自带的pool ntp.ubuntu.com 时间服务器地址池,就可以实现时间同步。用户也可以选择NTP官方网站推荐的pool pool.ntp.org地址池,或者选择中国区的pool cn.pool.ntp.org地址池,都会生效的。 ????????? 用户还可以选择集群中的1台作为主授时服务器(NTP 服务器角色),通过配置文件中的pool 地址池与上层的服务器同步时间,集群内所有其他机器(NTP客户端角色)的NTP配置文件中,使用Server xx.xx.xx.xx形式,明确指向主授时服务器IP地址,也可以实现为集群提供统一的时间服务。如果考虑高可靠性,还可以将多台服务器作为集群的授时服务器。 ???????? 也可以到

NTP服务搭建详解

匿名 (未验证) 提交于 2019-12-03 00:14:01
NTP服务搭建详解 ntp 和 ntpdate 区别   1.两个服务都是centos自带的(centos7中不自带ntp)。ntp的安装包名是ntp,ntpdate的安装包是ntpdate。他们并非由一个安装包提供。   2.ntp守护进程为ntpd,配置文件是/etc/ntp.conf   3.ntpdate用于客户端的时间矫正,非NTP服务器可以不启动NTP。 简介: ntp 全名 network time protocol 。 NTP 服务器可以为其他主机提供时间校对服务。 环境准备:两台服务器,一台作为 NTP 服务器,另一台作为 client 端向服务器同步时间测试。   NTP服务器:156.0.26.6   client端:156.0.0.27 安装与配置:我们从配置文件的角度来讲解一下 ntp 的配置   # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).      # Permit time synchronization with our time source, but do not   # permit the source to query or modify the service on this system.   restrict

CentOS 6.5_学习笔记_NTP服务器搭建

匿名 (未验证) 提交于 2019-12-02 23:57:01
NTP 服务器用于时间同步,局域网内可搭建一台 NTP 服务器,其余客户端连接 NTP 服务器获取时间,使所有客户端的时间保持一致. 1 服务器配置 ------ 1.1 安装 ntp 服务 [root@ ~]#: yum install ntp ntpdate -y Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile base                      | 3.7 kB 00:00 ... Complete! # 安装完成 ------ 1.2 修改配置文件 [root@ ~]#: cp /etc/ntp.conf /etc/ntp.conf.bak20190903 # 备份 [root@ ~]#: vi /etc/ntp.conf # 清空原有,输入以下: restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 server 127.127.1.0 # local clock,本地时钟 server pool.ntp.org